Changeset 5781 for code/trunk/src/libraries/core/Factory.cc
- Timestamp:
- Sep 24, 2009, 11:02:42 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/Factory.cc
r5774 r5781 55 55 56 56 /** 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 /** 57 71 @brief Adds a new Identifier to both maps. 58 72 @param name The name of the identifier … … 62 76 { 63 77 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(); 64 99 } 65 100
Note: See TracChangeset
for help on using the changeset viewer.