Changeset 4487 in orxonox.OLD for orxonox/trunk/src/util/loading/factory.h
- Timestamp:
- Jun 3, 2005, 12:56:57 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/trunk/src/util/loading/factory.h
r4261 r4487 16 16 /*! 17 17 \file factory.h 18 \brief philosophy stuff18 \brief A loadable object handler 19 19 */ 20 20 … … 34 34 */ 35 35 #define CREATE_FACTORY(CLASS_NAME) tFactory<CLASS_NAME>* global_##CLASS_NAME##Factory = new tFactory<CLASS_NAME>(#CLASS_NAME) 36 //! The Factory is 36 37 //! The Factory is a loadable object handler 37 38 class Factory { 38 39 39 40 public: 40 Factory (const char* name = NULL);41 Factory (const char* factoryName = NULL); 41 42 ~Factory (); 42 43 … … 45 46 void initialize(); 46 47 void registerFactory( Factory* factory); 47 void setFactoryName(const char* name); 48 const char* getFactoryName() {return factoryName;}; 49 void setNext( Factory* factory) {next = factory;} 50 Factory* getNext() {return next;} 48 void setFactoryName(const char* factoryName); 49 /** \returns the name of the factory */ 50 const char* getFactoryName() { return this->factoryName; }; 51 /** \brief sets the Next factory in the list \param nextFactory the next factory */ 52 inline void setNext( Factory* nextFactory) { this->next = nextFactory; }; 53 /** \returns the next factory */ 54 Factory* getNext(void) const { return this->next; }; 51 55 56 protected: 57 char* factoryName; //!< the name of the factory 52 58 private: 53 char* factoryName; 54 55 Factory* next; 59 Factory* next; //!< pointer to the next factory. 56 60 }; 57 61 62 /** 63 \brief a factory that is able to load any kind of Object 64 (this is a Functor) 65 */ 58 66 template<class T> class tFactory : public Factory 59 67 { 60 68 public: 61 tFactory(const char* name);69 tFactory(const char* factoryName); 62 70 virtual ~tFactory(); 63 71 … … 66 74 }; 67 75 76 /** 77 \brief construnts a factory with 78 \param factoryName the name of the factory 79 */ 68 80 template<class T> 69 tFactory<T>::tFactory(const char* name) : Factory(name)81 tFactory<T>::tFactory(const char* factoryName) : Factory(factoryName) 70 82 { 71 PRINTF(5)("fileName: %s \n", name);83 PRINTF(5)("fileName: %s loadable\n", this->factoryName); 72 84 } 73 85 … … 90 102 // helper function 91 103 92 const char* grabParameter(const TiXmlElement* root, const char* name);104 const char* grabParameter(const TiXmlElement* root, const char* parameterName); 93 105 94 106 #endif /* _FACTORY_H */
Note: See TracChangeset
for help on using the changeset viewer.