Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 5, 2009, 5:20:06 PM (15 years ago)
Author:
rgrieder
Message:

Stupid TSVN bug: All items in a commit list are always checked by default (which is exactly wrong). It was fixed again in the upcoming 1.6.4 version though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource2/src/core/Factory.cc

    r5610 r5611  
    7373        @param identifier The identifier to add
    7474    */
    75     void Factory::add(const std::string& name, BaseFactory* factory)
     75    void Factory::add(const std::string& name, Identifier* identifier)
    7676    {
    77         getFactoryPointer()->factoryMap_[name] = factory;
     77        getFactoryPointer()->identifierStringMap_[name] = identifier;
     78        getFactoryPointer()->identifierNetworkIDMap_[identifier->getNetworkID()] = identifier;
    7879    }
    7980
     
    104105    {
    105106        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)
    110111        {
    111             // Create the corresponding identifier first
    112             Identifier* identifier = it->second->createIdentifier(it->first);
    113             getFactoryPointer()->identifierStringMap_[it->first] = identifier;
    114             getFactoryPointer()->identifierNetworkIDMap_[identifier->getNetworkID()] = identifier;
    115112            // 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);
    117114            delete temp;
    118115        }
    119         Identifier::stopCreatingHierarchy();
     116        (*getFactoryPointer()->identifierStringMap_.begin()).second->stopCreatingHierarchy();
    120117        COUT(3) << "*** Factory: Finished class-hierarchy creation" << std::endl;
    121118    }
Note: See TracChangeset for help on using the changeset viewer.