Changeset 10624 for code/trunk/src/libraries/core/class/IdentifierManager.h
- Timestamp:
- Oct 4, 2015, 9:12:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
-
code/trunk/src/libraries/core/class/IdentifierManager.h
r9667 r10624 39 39 #include <map> 40 40 #include <set> 41 #include <list> 41 42 #include <string> 43 44 #include "util/Singleton.h" 42 45 43 46 namespace orxonox 44 47 { 45 class _CoreExport IdentifierManager 48 class _CoreExport IdentifierManager : public Singleton<IdentifierManager> 46 49 { 50 friend class Singleton<IdentifierManager>; 51 47 52 public: 48 static IdentifierManager& getInstance(); 53 IdentifierManager(); 54 ~IdentifierManager() {} 49 55 50 Identifier* getGloballyUniqueIdentifier(Identifier* proposal); 51 void addIdentifierToLookupMaps(Identifier* identifier); 52 53 unsigned int getUniqueClassId() 54 { return this->classIDCounter_s++; } 56 void addIdentifier(Identifier* identifier); 57 void removeIdentifier(Identifier* identifier); 55 58 56 59 … … 59 62 ///////////////////////////// 60 63 void createClassHierarchy(); 61 void destroyAllIdentifiers(); 64 void verifyClassHierarchy(const std::set<Identifier*>& initializedIdentifiers); 65 void destroyClassHierarchy(); 62 66 63 67 void createdObject(Identifiable* identifiable); … … 74 78 Identifier* getIdentifierByLowercaseString(const std::string& name); 75 79 Identifier* getIdentifierByID(uint32_t id); 80 Identifier* getIdentifierByTypeInfo(const std::type_info& typeInfo); 76 81 77 82 void clearNetworkIDs(); … … 88 93 89 94 private: 90 IdentifierManager(); 91 IdentifierManager(const IdentifierManager&); 92 ~IdentifierManager() {} 95 IdentifierManager(const IdentifierManager&); // not implemented 93 96 94 97 /// Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents. … … 99 102 { hierarchyCreatingCounter_s--; } 100 103 101 std::map<std::string, Identifier*> identifierByTypeidName_; //!< Map with the names as received by typeid(). This is only used internally. 102 104 std::set<Identifier*> identifiers_; //!< All identifiers. This is only used internally. 103 105 std::map<std::string, Identifier*> identifierByString_; //!< Map that stores all Identifiers with their names. 104 106 std::map<std::string, Identifier*> identifierByLowercaseString_; //!< Map that stores all Identifiers with their names in lowercase. … … 106 108 107 109 int hierarchyCreatingCounter_s; //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading) 108 std::set<const Identifier*> identifiersOfNewObject_; //!< Used while creating the object hierarchy to keep track of the identifiers of a newly created object 109 unsigned int classIDCounter_s; //!< counter for the unique classIDs 110 111 /// Used while creating the object hierarchy to keep track of the identifiers of a newly created object (and all other objects that get created as 112 /// a consequence of this, e.g. nested member objects). 113 std::map<Identifiable*, std::list<const Identifier*> > identifierTraceOfNewObject_; 114 Identifier* recordTraceForIdentifier_; //!< The identifier for which we want to record the trace of identifiers during object creation. If null, no trace is recorded. 115 116 static IdentifierManager* singletonPtr_s; 110 117 }; 111 118 }
Note: See TracChangeset
for help on using the changeset viewer.