Changeset 7214 in orxonox.OLD for branches/std/src/lib/lang/base_object.cc
- Timestamp:
- Mar 10, 2006, 7:18:03 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/std/src/lib/lang/base_object.cc
r7203 r7214 37 37 this->classID = CL_BASE_OBJECT; 38 38 39 this->objectName = NULL;39 this->objectName = ""; 40 40 this->classList = NULL; 41 41 this->xmlElem = NULL; … … 52 52 53 53 // delete []this->className; 54 if (this->objectName)55 delete[] this->objectName;56 54 if (this->xmlElem != NULL) 57 55 delete this->xmlElem; … … 97 95 void BaseObject::setName (const std::string& objectName) 98 96 { 99 if (this->objectName) 100 delete[] this->objectName; 101 if (!objectName.empty()) 102 { 103 this->objectName = new char[objectName.size()+1]; 104 strcpy(this->objectName, objectName.c_str()); 105 } 106 else 107 this->objectName = NULL; 97 printf("TEST\n"); 98 this->objectName = objectName; 99 printf("TEST2\n"); 108 100 } 109 101 … … 175 167 bool BaseObject::operator==(const char* objectName) 176 168 { 177 if (likely(this->objectName != NULL && objectName != NULL)) 178 return (strcmp(this->objectName, objectName)) ? false : true; 169 return (objectName != NULL && this->objectName == objectName); 179 170 } 180 171 … … 197 188 int BaseObject::writeState( const byte * data, int length, int sender ) 198 189 { 199 SYNCHELP_READ_BEGIN(); 200 201 if ( objectName ) 190 /// FIXME STD 191 192 /* SYNCHELP_READ_BEGIN(); 193 194 if ( !objectName.empty() ) 202 195 { 203 196 delete[] objectName; … … 211 204 } 212 205 213 return SYNCHELP_READ_N; 206 return SYNCHELP_READ_N;*/ 214 207 } 215 208 … … 222 215 int BaseObject::readState( byte * data, int maxLength ) 223 216 { 224 SYNCHELP_WRITE_BEGIN(); 217 ///FIXME STD 218 /* SYNCHELP_WRITE_BEGIN(); 225 219 226 220 //PRINTF(0)("objectname = %s\n", this->objectName); 227 221 SYNCHELP_WRITE_STRING( this->objectName, NWT_BO_NAME ); 228 222 229 return SYNCHELP_WRITE_N; 230 } 223 return SYNCHELP_WRITE_N;*/ 224 }
Note: See TracChangeset
for help on using the changeset viewer.