Changeset 4435 in orxonox.OLD for orxonox/trunk/src/lib/lang
- Timestamp:
- Jun 1, 2005, 11:40:19 AM (19 years ago)
- Location:
- orxonox/trunk/src/lib/lang
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/lib/lang/base_object.cc
r4321 r4435 32 32 this->id = -1; 33 33 this->finalized = false; 34 35 this->objectName = NULL; 34 36 } 35 37 … … 41 43 { 42 44 // delete []this->className; 45 if (this->objectName) 46 delete []this->objectName; 43 47 } 44 48 … … 96 100 this->finalized = true; 97 101 } 102 103 104 /** 105 \brief set the name of the node 106 107 for debug purposes realy usefull, not used to work properly 108 */ 109 void BaseObject::setName (const char* newName) 110 { 111 if (this->objectName) 112 delete []this->objectName; 113 if (newName) 114 { 115 this->objectName = new char[strlen(newName)+1]; 116 strcpy(this->objectName, newName); 117 } 118 else 119 this->objectName = NULL; 120 } -
orxonox/trunk/src/lib/lang/base_object.h
r4382 r4435 31 31 void finalize(); 32 32 33 void setName (const char* newName); 34 const char* getName (void)const { return this->objectName; }; 35 33 36 private: 34 const char* className; //!< the name of the class 35 int id; //!< this is the id from the class_list.h enumeration 36 bool finalized; //!< is true if the object is ready to be garbage collected 37 const char* className; //!< the name of the class 38 int id; //!< this is the id from the class_list.h enumeration 39 bool finalized; //!< is true if the object is ready to be garbage collected 40 41 char* objectName; //!< The name of this object 37 42 }; 38 43
Note: See TracChangeset
for help on using the changeset viewer.