Changeset 5774 for code/trunk/src/libraries/core/Factory.cc
- Timestamp:
- Sep 23, 2009, 11:31:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/Factory.cc
r5738 r5774 55 55 56 56 /** 57 @brief Returns the Identifier with a given network ID.58 @param id The network ID of the wanted Identifier59 @return The Identifier60 */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 else67 return 0;68 }69 70 /**71 57 @brief Adds a new Identifier to both maps. 72 58 @param name The name of the identifier … … 76 62 { 77 63 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 change84 @param oldID The old networkID85 @param newID The new networkID86 */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();99 64 } 100 65
Note: See TracChangeset
for help on using the changeset viewer.