Changeset 563 for code/branches/FICN/src/orxonox
- Timestamp:
- Dec 17, 2007, 4:02:14 AM (17 years ago)
- Location:
- code/branches/FICN/src/orxonox/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/orxonox/core/Factory.cc
r562 r563 38 38 namespace orxonox 39 39 { 40 Factory* Factory::pointer_s = 0;41 42 40 /** 43 41 @returns the Identifier with a given name. … … 105 103 Factory* Factory::getFactoryPointer() 106 104 { 107 // static Factory theOneAndOnlyInstance = Factory(); 108 // return &theOneAndOnlyInstance; 109 if (!pointer_s) 110 pointer_s = new Factory(); 111 112 return pointer_s; 105 static Factory theOneAndOnlyInstance = Factory(); 106 return &theOneAndOnlyInstance; 113 107 } 114 108 } -
code/branches/FICN/src/orxonox/core/Factory.h
r562 r563 37 37 static void changeNetworkID(Identifier* identifier, const unsigned int oldID, const unsigned int newID); 38 38 static void createClassHierarchy(); 39 39 40 static Factory* getFactoryPointer();// avoid overriding pointer_s in the static intialisation process 40 41 … … 43 44 Factory(const Factory& factory) {} // don't copy 44 45 ~Factory() {} // don't delete 46 static void checkPointer(); 45 47 46 static Factory* pointer_s;47 48 std::map<std::string, Identifier*> identifierStringMap_; //!< The map, mapping the name with the Identifier 48 49 std::map<unsigned int, Identifier*> identifierNetworkIDMap_; //!< The map, mapping the network ID with the Identifier
Note: See TracChangeset
for help on using the changeset viewer.