Changeset 7221 in orxonox.OLD for trunk/src/lib/lang/base_object.h
- Timestamp:
- Mar 15, 2006, 3:10:45 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/lang/base_object.h
r6587 r7221 16 16 #endif 17 17 18 #include <string> 18 19 #include "stdincl.h" 19 20 … … 30 31 31 32 virtual void loadParams(const TiXmlElement* root); 32 void setName (const char*newName);33 void setName (const std::string& newName); 33 34 /** returns the Name of this Object */ 34 inline const char* getName ()const { return this->objectName ; };35 inline const char* getName ()const { return this->objectName.c_str(); }; 35 36 /** @returns the XML-Element with whicht this Object was loaded */ 36 37 inline TiXmlNode* getXmlElem() const { return this->xmlElem; }; 37 38 38 39 /** @returns the className of the corresponding Object */ 39 inline const char* getClassName() const { return this->className ; };40 inline const char* getClassName() const { return this->className.c_str(); }; 40 41 /** @returns the classID of the corresponding Object */ 41 42 inline int getClassID() const { return this->classID; }; … … 43 44 44 45 bool isA (ClassID classID) const; 45 bool isA (const char*className) const;46 bool isA (const std::string& className) const; 46 47 void whatIs() const; 47 48 48 bool operator==(const char*objectName);49 bool operator==(const std::string& objectName); 49 50 /** @param classID comparer for a ClassID @returns true on match, false otherwise */ 50 51 bool operator==(ClassID classID) { return this->isA(classID); }; … … 54 55 55 56 protected: 56 void setClassID(ClassID classID, const char*className);57 void setClassID(ClassID classID, const std::string& className); 57 58 58 59 private: 59 const char*className; //!< the name of the class60 std::string className; //!< the name of the class 60 61 long classID; //!< this is the id from the class_id.h enumeration 61 char*objectName; //!< The name of this object62 std::string objectName; //!< The name of this object 62 63 63 64 ClassList* classList; //!< Pointer to the ClassList this Object is inside of
Note: See TracChangeset
for help on using the changeset viewer.