Changeset 5611 for code/branches/resource2/src/core/Factory.cc
- Timestamp:
- Aug 5, 2009, 5:20:06 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/resource2/src/core/Factory.cc
r5610 r5611 73 73 @param identifier The identifier to add 74 74 */ 75 void Factory::add(const std::string& name, BaseFactory* factory)75 void Factory::add(const std::string& name, Identifier* identifier) 76 76 { 77 getFactoryPointer()->factoryMap_[name] = factory; 77 getFactoryPointer()->identifierStringMap_[name] = identifier; 78 getFactoryPointer()->identifierNetworkIDMap_[identifier->getNetworkID()] = identifier; 78 79 } 79 80 … … 104 105 { 105 106 COUT(3) << "*** Factory: Create class-hierarchy" << std::endl; 106 std::map<std::string, BaseFactory*>::iterator it;107 it = getFactoryPointer()-> factoryMap_.begin();108 Identifier::startCreatingHierarchy();109 for (it = getFactoryPointer()-> factoryMap_.begin(); it != getFactoryPointer()->factoryMap_.end(); ++it)107 std::map<std::string, Identifier*>::iterator it; 108 it = getFactoryPointer()->identifierStringMap_.begin(); 109 (*getFactoryPointer()->identifierStringMap_.begin()).second->startCreatingHierarchy(); 110 for (it = getFactoryPointer()->identifierStringMap_.begin(); it != getFactoryPointer()->identifierStringMap_.end(); ++it) 110 111 { 111 // Create the corresponding identifier first112 Identifier* identifier = it->second->createIdentifier(it->first);113 getFactoryPointer()->identifierStringMap_[it->first] = identifier;114 getFactoryPointer()->identifierNetworkIDMap_[identifier->getNetworkID()] = identifier;115 112 // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards. 116 BaseObject* temp = identifier->fabricate(0);113 BaseObject* temp = (*it).second->fabricate(0); 117 114 delete temp; 118 115 } 119 Identifier::stopCreatingHierarchy();116 (*getFactoryPointer()->identifierStringMap_.begin()).second->stopCreatingHierarchy(); 120 117 COUT(3) << "*** Factory: Finished class-hierarchy creation" << std::endl; 121 118 }
Note: See TracChangeset
for help on using the changeset viewer.