Changeset 365 for code/branches/objecthierarchy/src/orxonox/core/Factory.h
- Timestamp:
- Dec 1, 2007, 4:24:56 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/core/Factory.h
r362 r365 1 /*! 2 @file Factory.h 3 @brief Definition of the Factory and the BaseFactory class. 4 5 The Factory is a singleton, containing two maps to map either the name or the networkID 6 of a class with the corresponding Identifier. 7 8 Usage: 9 ID(classname) or ID(networkID) returns the corresponding Identifier. 10 11 12 BaseObject is the parent of ClassFactory which is defined in ClassFactory.h. 13 It can't be defined in ClassFactory.h, because of circular dependencies. 14 */ 15 1 16 #ifndef _Factory_H__ 2 17 #define _Factory_H__ … … 7 22 namespace orxonox 8 23 { 9 class BaseObject; 10 class Identifier; 24 class BaseObject; // Forward declaration 25 class Identifier; // Forward declaration 11 26 12 27 // ############################### 13 28 // ### Factory ### 14 29 // ############################### 30 //! The Factory is used to map name or networkID of a class with its Identifier. 15 31 class Factory 16 32 { … … 22 38 23 39 private: 24 Factory() {} 25 Factory(const Factory& factory) {} 26 ~Factory() {} 40 Factory() {} // don't create 41 Factory(const Factory& factory) {} // don't copy 42 ~Factory() {} // don't delete 27 43 28 static Factory* pointer_s; 29 std::map<std::string, Identifier*> identifierStringMap_; 30 std::map<unsigned int, Identifier*> identifierNetworkIDMap_; 44 static Factory* pointer_s; //!< The pointer to the singleton 45 std::map<std::string, Identifier*> identifierStringMap_; //!< The map mapping string with Identifier 46 std::map<unsigned int, Identifier*> identifierNetworkIDMap_; //!< The map mapping networkID with Identifier 31 47 }; 32 48 … … 34 50 // ### BaseFactory ### 35 51 // ############################### 52 //! Base-class of ClassFactory. Has to be defined separate because of circular dependencies. 36 53 class BaseFactory 37 54 {
Note: See TracChangeset
for help on using the changeset viewer.