- Timestamp:
- Aug 11, 2013, 10:42:57 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/class/IdentifierManager.cc
r9641 r9644 57 57 /** 58 58 @brief Returns an identifier by name and adds it if not available 59 @param name The name of the identifier as typeid().name() suggests60 59 @param proposal A pointer to a newly created identifier for the case of non existence in the map 61 60 @return The identifier (unique instance) 62 61 */ 63 Identifier* IdentifierManager::getIdentifierSingleton( const std::string& name,Identifier* proposal)62 Identifier* IdentifierManager::getIdentifierSingleton(Identifier* proposal) 64 63 { 65 std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeId_.find(name); 64 const std::string& typeidName = proposal->getTypeidName(); 65 std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.find(typeidName); 66 66 67 if (it != this->identifierByType Id_.end())67 if (it != this->identifierByTypeidName_.end()) 68 68 { 69 // There is already an entry: return it and delete the proposal 70 delete proposal; 69 // There is already an entry: return it 71 70 return it->second; 72 71 } … … 74 73 { 75 74 // There is no entry: put the proposal into the map and return it 76 this->identifierByType Id_[name] = proposal;75 this->identifierByTypeidName_[typeidName] = proposal; 77 76 return proposal; 78 77 } … … 96 95 orxout(internal_status) << "Create class-hierarchy" << endl; 97 96 this->startCreatingHierarchy(); 98 for (std::map<std::string, Identifier*>::const_iterator it = this->identifierByType Id_.begin(); it != this->identifierByTypeId_.end(); ++it)97 for (std::map<std::string, Identifier*>::const_iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it) 99 98 { 100 99 // To create the new branch of the class-hierarchy, we create a new object and delete it afterwards. … … 114 113 void IdentifierManager::destroyAllIdentifiers() 115 114 { 116 for (std::map<std::string, Identifier*>::iterator it = this->identifierByType Id_.begin(); it != this->identifierByTypeId_.end(); ++it)115 for (std::map<std::string, Identifier*>::iterator it = this->identifierByTypeidName_.begin(); it != this->identifierByTypeidName_.end(); ++it) 117 116 delete (it->second); 118 117 119 this->identifierByType Id_.clear();118 this->identifierByTypeidName_.clear(); 120 119 this->identifierByString_.clear(); 121 120 this->identifierByLowercaseString_.clear();
Note: See TracChangeset
for help on using the changeset viewer.