Changeset 4729 in orxonox.OLD for orxonox/trunk
- Timestamp:
- Jun 29, 2005, 12:05:16 AM (19 years ago)
- Location:
- orxonox/trunk/src/util/loading
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/factory.cc
r4725 r4729 35 35 this->setName(factoryName); 36 36 37 this->factoryName = NULL;38 this->setFactoryName(factoryName);39 37 next = NULL; 40 38 … … 54 52 if (this->next) 55 53 delete this->next; 56 57 if (this->factoryName)58 delete []this->factoryName;59 54 } 60 61 /**62 \brief sets the name of this factory63 */64 void Factory::setFactoryName(const char* factoryName)65 {66 if (this->factoryName)67 delete this->factoryName;68 this->factoryName = new char[strlen(factoryName)+1];69 strcpy(this->factoryName, factoryName);70 }71 72 55 73 56 /** -
orxonox/trunk/src/util/loading/factory.h
r4597 r4729 48 48 void initialize(); 49 49 void registerFactory( Factory* factory); 50 void setFactoryName(const char* factoryName);51 /** \returns the name of the factory */52 const char* getFactoryName() { return this->factoryName; };53 50 /** \brief sets the Next factory in the list \param nextFactory the next factory */ 54 51 inline void setNext( Factory* nextFactory) { this->next = nextFactory; }; … … 56 53 Factory* getNext(void) const { return this->next; }; 57 54 58 protected:59 char* factoryName; //!< the name of the factory60 55 private: 61 Factory* next; //!< pointer to the next factory. 56 Factory* next; //!< pointer to the next factory. 57 static Factory* first; //!< A pointer to the first factory. 62 58 }; 63 59 … … 83 79 tFactory<T>::tFactory(const char* factoryName) : Factory(factoryName) 84 80 { 85 PRINTF(5)("fileName: %s loadable\n", this-> factoryName);81 PRINTF(5)("fileName: %s loadable\n", this->getName()); 86 82 } 87 83 … … 94 90 BaseObject* tFactory<T>::fabricate(const TiXmlElement* root) 95 91 { 96 if(!strcmp(root->Value(), get FactoryName()))92 if(!strcmp(root->Value(), getName())) 97 93 return new T ( root); 98 94 else if( getNext() != NULL) -
orxonox/trunk/src/util/loading/game_loader.cc
r4598 r4729 326 326 assert( factory != NULL); 327 327 328 PRINTF(4)("Registered factory for '%s'\n", factory->get FactoryName());328 PRINTF(4)("Registered factory for '%s'\n", factory->getName()); 329 329 330 330 if( first == NULL) first = factory;
Note: See TracChangeset
for help on using the changeset viewer.