Changeset 9641 for code/branches/core6/src/libraries/core
- Timestamp:
- Aug 11, 2013, 9:33:11 PM (11 years ago)
- Location:
- code/branches/core6/src/libraries/core/class
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/class/Identifier.cc
r9640 r9641 50 50 */ 51 51 Identifier::Identifier() 52 : classID_(IdentifierManager::getInstance(). classIDCounter_s++)52 : classID_(IdentifierManager::getInstance().getUniqueClassId()) 53 53 { 54 54 this->bCreatedOneObject_ = false; … … 155 155 this->name_ = name; 156 156 this->bSetName_ = true; 157 IdentifierManager::getInstance().identifierByString_[name] = this; 158 IdentifierManager::getInstance().identifierByLowercaseString_[getLowercase(name)] = this; 159 IdentifierManager::getInstance().identifierByNetworkId_[this->networkID_] = this; 157 IdentifierManager::getInstance().registerIdentifier(this); 160 158 } 161 159 } … … 195 193 void Identifier::setNetworkID(uint32_t id) 196 194 { 197 // Identifier::getIDIdentifierMapIntern().erase(this->networkID_);198 IdentifierManager::getInstance().identifierByNetworkId_[id] = this;199 195 this->networkID_ = id; 196 IdentifierManager::getInstance().registerIdentifier(this); 200 197 } 201 198 -
code/branches/core6/src/libraries/core/class/Identifier.h
r9640 r9641 106 106 class _CoreExport Identifier 107 107 { 108 friend class IdentifierManager;109 110 108 public: 109 Identifier(); 110 Identifier(const Identifier& identifier); // don't copy 111 virtual ~Identifier(); 112 111 113 /// Returns the name of the class the Identifier belongs to. 112 114 inline const std::string& getName() const { return this->name_; } … … 209 211 210 212 protected: 211 Identifier();212 Identifier(const Identifier& identifier); // don't copy213 virtual ~Identifier();214 215 213 virtual void createSuperFunctionCaller() const = 0; 216 214 -
code/branches/core6/src/libraries/core/class/IdentifierManager.cc
r9640 r9641 77 77 return proposal; 78 78 } 79 } 80 81 /** 82 * Registers the identifier in all maps of the IdentifierManager. 83 */ 84 void IdentifierManager::registerIdentifier(Identifier* identifier) 85 { 86 IdentifierManager::getInstance().identifierByString_[identifier->getName()] = identifier; 87 IdentifierManager::getInstance().identifierByLowercaseString_[getLowercase(identifier->getName())] = identifier; 88 IdentifierManager::getInstance().identifierByNetworkId_[identifier->getNetworkID()] = identifier; 79 89 } 80 90 -
code/branches/core6/src/libraries/core/class/IdentifierManager.h
r9640 r9641 44 44 class _CoreExport IdentifierManager 45 45 { 46 friend class Identifier;47 template <class T> friend class ClassIdentifier;48 49 46 public: 50 47 static IdentifierManager& getInstance(); … … 53 50 ////// Class Hierarchy ////// 54 51 ///////////////////////////// 52 Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal); 53 54 unsigned int getUniqueClassId() 55 { return this->classIDCounter_s++; } 56 57 void registerIdentifier(Identifier* identifier); 58 55 59 void createClassHierarchy(); 56 60 … … 101 105 { return this->identifierByNetworkId_.end(); } 102 106 103 protected:104 Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal);105 106 107 private: 107 108 IdentifierManager();
Note: See TracChangeset
for help on using the changeset viewer.