Changeset 2344 for code/branches/objecthierarchy2/src/core/Identifier.cc
- Timestamp:
- Dec 4, 2008, 8:28:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy2/src/core/Identifier.cc
r2171 r2344 93 93 for (std::map<std::string, XMLPortObjectContainer*>::iterator it = this->xmlportObjectContainers_.begin(); it != this->xmlportObjectContainers_.end(); ++it) 94 94 delete (it->second); 95 for (std::vector<Functor*>::iterator it = this->constructionCallbacks_.begin(); it != this->constructionCallbacks_.end(); ++it) 96 delete *it; 97 } 98 99 /** 100 @brief Returns the identifier map with the names as received by typeid(). This is only used internally. 101 */ 102 std::map<std::string, Identifier*>& Identifier::getTypeIDIdentifierMap() 103 { 104 static std::map<std::string, Identifier*> identifiers; //!< The map to store all Identifiers. 105 return identifiers; 95 106 } 96 107 … … 103 114 Identifier* Identifier::getIdentifierSingleton(const std::string& name, Identifier* proposal) 104 115 { 105 static std::map<std::string, Identifier*> identifiers; //!< The map to store all Identifiers. 106 std::map<std::string, Identifier*>::const_iterator it = identifiers.find(name); 107 108 if (it != identifiers.end()) 116 std::map<std::string, Identifier*>::const_iterator it = getTypeIDIdentifierMap().find(name); 117 118 if (it != getTypeIDIdentifierMap().end()) 109 119 { 110 120 // There is already an entry: return it and delete the proposal … … 115 125 { 116 126 // There is no entry: put the proposal into the map and return it 117 identifiers[name] = proposal;127 getTypeIDIdentifierMap()[name] = proposal; 118 128 return proposal; 119 129 } … … 192 202 void Identifier::destroyAllIdentifiers() 193 203 { 194 for (std::map<std::string, Identifier*>::iterator it = Identifier::get IdentifierMapIntern().begin(); it != Identifier::getIdentifierMapIntern().end(); ++it)204 for (std::map<std::string, Identifier*>::iterator it = Identifier::getTypeIDIdentifierMap().begin(); it != Identifier::getTypeIDIdentifierMap().end(); ++it) 195 205 delete (it->second); 196 206 }
Note: See TracChangeset
for help on using the changeset viewer.