Changeset 4487 in orxonox.OLD for orxonox/trunk/src/util/loading/factory.cc
- Timestamp:
- Jun 3, 2005, 12:56:57 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/factory.cc
r4261 r4487 30 30 set everything to zero and define factoryName 31 31 */ 32 Factory::Factory (const char* name)32 Factory::Factory (const char* factoryName) 33 33 { 34 34 this->factoryName = NULL; 35 this->setFactoryName( name);35 this->setFactoryName(factoryName); 36 36 next = NULL; 37 37 … … 51 51 if (this->next) 52 52 delete this->next; 53 54 if (this->factoryName) 55 delete []this->factoryName; 53 56 } 54 57 55 void Factory::setFactoryName(const char* name) 58 /** 59 \brief sets the name of this factory 60 */ 61 void Factory::setFactoryName(const char* factoryName) 56 62 { 57 if ( factoryName)58 delete factoryName;59 factoryName = new char[strlen(name)+1];60 strcpy( factoryName, name);63 if (this->factoryName) 64 delete this->factoryName; 65 this->factoryName = new char[strlen(factoryName)+1]; 66 strcpy(this->factoryName, factoryName); 61 67 } 62 68 … … 88 94 } 89 95 90 const char* grabParameter(const TiXmlElement* root, const char* name) 96 /** 97 \param root: The XML-element to grab a parameter from 98 \param parameterName: the parameter to grab 99 \returns the Value of the parameter if found, NULL otherwise 100 */ 101 const char* grabParameter(const TiXmlElement* root, const char* parameterName) 91 102 { 92 103 const TiXmlElement* element; … … 95 106 if (root == NULL) 96 107 return NULL; 97 assert( name != NULL);108 assert( parameterName != NULL); 98 109 99 element = root->FirstChildElement( name);110 element = root->FirstChildElement( parameterName); 100 111 if( element == NULL) return NULL; 101 112
Note: See TracChangeset
for help on using the changeset viewer.