Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 24, 2009, 11:02:42 AM (15 years ago)
Author:
rgrieder
Message:

Reverted trunk again. We might want to find a way to delete these revisions again (x3n's changes are still available as diff in the commit mails).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/libraries/core/Factory.cc

    r5774 r5781  
    5555
    5656    /**
     57        @brief Returns the Identifier with a given network ID.
     58        @param id The network ID of the wanted Identifier
     59        @return The Identifier
     60    */
     61    Identifier* Factory::getIdentifier(const uint32_t id)
     62    {
     63        std::map<uint32_t, Identifier*>::const_iterator it = getFactoryPointer()->identifierNetworkIDMap_.find(id);
     64        if (it != getFactoryPointer()->identifierNetworkIDMap_.end())
     65            return it->second;
     66        else
     67            return 0;
     68    }
     69
     70    /**
    5771        @brief Adds a new Identifier to both maps.
    5872        @param name The name of the identifier
     
    6276    {
    6377        getFactoryPointer()->identifierStringMap_[name] = identifier;
     78        getFactoryPointer()->identifierNetworkIDMap_[identifier->getNetworkID()] = identifier;
     79    }
     80
     81    /**
     82        @brief Removes the entry with the old network ID and adds a new one.
     83        @param identifier The identifier to change
     84        @param oldID The old networkID
     85        @param newID The new networkID
     86    */
     87    void Factory::changeNetworkID(Identifier* identifier, const uint32_t oldID, const uint32_t newID)
     88    {
     89//        getFactoryPointer()->identifierNetworkIDMap_.erase(oldID);
     90        getFactoryPointer()->identifierNetworkIDMap_[newID] = identifier;
     91    }
     92
     93    /**
     94        @brief Cleans the NetworkID map (needed on clients for correct initialization)
     95    */
     96    void Factory::cleanNetworkIDs()
     97    {
     98        getFactoryPointer()->identifierNetworkIDMap_.clear();
    6499    }
    65100
Note: See TracChangeset for help on using the changeset viewer.