Changeset 4591 in orxonox.OLD for orxonox/trunk/src/lib
- Timestamp:
- Jun 10, 2005, 6:21:25 PM (19 years ago)
- Location:
- orxonox/trunk/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/lang/base_object.cc
r4470 r4591 1 1 2 2 3 /* 3 /* 4 4 orxonox - the future of 3D-vertical-scrollers 5 5 … … 30 30 { 31 31 this->className = NULL; 32 this-> id = -1;32 this->classID = CL_BASE_OBJECT; 33 33 this->finalized = false; 34 34 … … 42 42 \brief standard deconstructor 43 43 */ 44 BaseObject::~BaseObject () 44 BaseObject::~BaseObject () 45 45 { 46 46 // delete []this->className; … … 57 57 // name setup 58 58 LoadParam<BaseObject>(root, "name", this, &BaseObject::setName) 59 59 .describe("the name of the Object at hand"); 60 60 } 61 61 … … 65 65 \param className the class name 66 66 */ 67 void BaseObject::setClassID( int id, const char* className)67 void BaseObject::setClassID(long classID, const char* className) 68 68 { 69 this-> id = id;70 this-> className = className;69 this->setClassID(classID); 70 this->setClassName(className); 71 71 } 72 72 … … 76 76 \param id a number for the class from class_list.h enumeration 77 77 */ 78 void BaseObject::setClassID ( int id)78 void BaseObject::setClassID (long classID) 79 79 { 80 this-> id = id;80 this->classID = classID; 81 81 } 82 82 … … 106 106 107 107 /** 108 \brief set the name of the node 109 110 for debug purposes realy usefull, not used to work properly 111 */ 112 void BaseObject::setName (const char* newName) 108 \brief set the name of the Object 109 */ 110 void BaseObject::setName (const char* objectName) 113 111 { 114 112 if (this->objectName) 115 113 delete []this->objectName; 116 if ( newName)114 if (objectName) 117 115 { 118 this->objectName = new char[strlen( newName)+1];119 strcpy(this->objectName, newName);116 this->objectName = new char[strlen(objectName)+1]; 117 strcpy(this->objectName, objectName); 120 118 } 121 else 119 else 122 120 this->objectName = NULL; 123 121 } -
orxonox/trunk/src/lib/lang/base_object.h
r4539 r4591 1 /*! 1 /*! 2 2 \file base_object.h 3 3 \brief Definition of the base object class. … … 30 30 void setName (const char* newName); 31 31 /** \brief returns the Name of this Object */ 32 const char* getName (void)const { return this->objectName; };32 inline const char* getName (void)const { return this->objectName; }; 33 33 34 34 /** \returns the className of the corresponding Object */ 35 inline const char* getClassName(void) const { return this->className; };35 inline const char* getClassName(void) const { return this->className; }; 36 36 /** \returns the classID of the corresponding Object */ 37 inline int getClassID(void) const { return this-> id; }37 inline int getClassID(void) const { return this->classID; } 38 38 39 39 // bool isA (char* className); … … 44 44 45 45 protected: 46 void setClassID( int id);46 void setClassID(long classID); 47 47 void setClassName(const char* className); 48 void setClassID( int id, const char* className);48 void setClassID(long classID, const char* className); 49 49 50 50 /** \brief this finalizes an object and makes it ready to be garbage collected */ … … 52 52 53 53 private: 54 const char* className; //!< the name of the class 55 int id; //!< this is the id from the class_list.h enumeration 54 const char* className; //!< the name of the class 55 long classID; //!< this is the id from the class_list.h enumeration 56 char* objectName; //!< The name of this object 57 56 58 bool finalized; //!< is true if the object is ready to be garbage collected 57 58 char* objectName; //!< The name of this object59 59 }; 60 60
Note: See TracChangeset
for help on using the changeset viewer.