Changeset 457 for code/branches/objecthierarchy/src/orxonox/core/Factory.cc
- Timestamp:
- Dec 10, 2007, 8:34:48 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/core/Factory.cc
r447 r457 6 6 #include "Factory.h" 7 7 #include "Identifier.h" 8 #include "Debug.h" 9 #include "../objects/BaseObject.h" 8 10 9 11 namespace orxonox … … 60 62 pointer_s->identifierNetworkIDMap_[newID] = identifier; 61 63 } 64 65 /** 66 @brief Creates the class-hierarchy by creating and destroying one object of each type. 67 */ 68 void Factory::createClassHierarchy() 69 { 70 if (!pointer_s) 71 pointer_s = new Factory; 72 73 COUT(4) << "*** Factory -> Create class-hierarchy\n"; 74 std::map<std::string, Identifier*>::iterator it; 75 it = pointer_s->identifierStringMap_.begin(); 76 (*pointer_s->identifierStringMap_.begin()).second->startCreatingHierarchy(); 77 for (it = pointer_s->identifierStringMap_.begin(); it != pointer_s->identifierStringMap_.end(); ++it) 78 { 79 // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards. 80 BaseObject* temp = (*it).second->fabricate(); 81 delete temp; 82 } 83 (*pointer_s->identifierStringMap_.begin()).second->stopCreatingHierarchy(); 84 COUT(4) << "*** Factory -> Finished class-hierarchy creation\n"; 85 } 62 86 }
Note: See TracChangeset
for help on using the changeset viewer.