Changeset 219 for code/branches/objecthierarchie/src/Factory.cc
- Timestamp:
- Nov 19, 2007, 10:10:11 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchie/src/Factory.cc
r218 r219 1 1 #include "Factory.h" 2 2 #include "Identifier.h" 3 #include "BaseObject.h" 3 4 4 5 namespace orxonox 5 6 { 6 ClassFactory* ClassFactory::pointer_ = NULL;7 ClassFactory* ClassFactory::pointer_s = NULL; 7 8 8 OrxonoxClass* ClassFactory::fabricate(const std::string& name)9 BaseObject* ClassFactory::fabricate(const std::string& name) 9 10 { 10 if (!pointer_ )11 pointer_ = new ClassFactory;11 if (!pointer_s) 12 pointer_s = new ClassFactory; 12 13 13 return pointer_ ->identifierMap_[name]->fabricate();14 return pointer_s->identifierMap_[name]->fabricate(); 14 15 } 15 16 16 17 void ClassFactory::add(const std::string& name, Identifier* identifier) 17 18 { 18 if (!pointer_ )19 pointer_ = new ClassFactory;19 if (!pointer_s) 20 pointer_s = new ClassFactory; 20 21 21 pointer_ ->identifierMap_[name] = identifier;22 pointer_s->identifierMap_[name] = identifier; 22 23 } 23 24 }
Note: See TracChangeset
for help on using the changeset viewer.