Orxonox
0.0.5 Codename: Arcturus
|
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/class/IdentifierManager.h>
Public Member Functions | |
IdentifierManager () | |
~IdentifierManager ()=default | |
void | addIdentifier (Identifier *identifier) |
Registers the identifier in all maps of the IdentifierManager. More... | |
void | clearNetworkIDs () |
Cleans the NetworkID map (needed on clients for correct initialization) More... | |
void | createClassHierarchy () |
Creates the class-hierarchy by creating and destroying one object of each type. More... | |
void | createdObject (Identifiable *identifiable) |
Notifies the IdentifierManager about a newly created object while creating the class hierarchy. More... | |
void | destroyClassHierarchy () |
Resets all Identifiers. More... | |
Identifier * | getIdentifierByID (uint32_t id) |
Returns the Identifier with a given network ID. More... | |
Identifier * | getIdentifierByLowercaseString (const std::string &name) |
Returns the Identifier with a given name in lowercase. More... | |
const std::map< std::string, Identifier * > & | getIdentifierByLowercaseStringMap () |
Returns the map that stores all Identifiers with their names in lowercase. More... | |
const std::map< uint32_t, Identifier * > & | getIdentifierByNetworkIdMap () |
Returns the map that stores all Identifiers with their IDs. More... | |
Identifier * | getIdentifierByString (const std::string &name) |
Returns the Identifier with a given name. More... | |
const std::map< std::string, Identifier * > & | getIdentifierByStringMap () |
Returns the map that stores all Identifiers with their names. More... | |
Identifier * | getIdentifierByTypeInfo (const std::type_info &typeInfo) |
Returns the Identifier with a given typeid-name. More... | |
bool | isCreatingHierarchy () |
Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. More... | |
void | removeIdentifier (Identifier *identifier) |
Unregisters the identifier from all maps of the IdentifierManager. More... | |
void | verifyClassHierarchy (const std::set< Identifier * > &initializedIdentifiers) |
Verifies if the class hierarchy is consistent with the RTTI. More... | |
Private Member Functions | |
IdentifierManager (const IdentifierManager &)=delete | |
IdentifierManager & | operator= (const IdentifierManager &)=delete |
void | startCreatingHierarchy () |
Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents. More... | |
void | stopCreatingHierarchy () |
Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents. More... | |
Private Attributes | |
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) More... | |
std::map< std::string, Identifier * > | identifierByLowercaseString_ |
Map that stores all Identifiers with their names in lowercase. More... | |
std::map< uint32_t, Identifier * > | identifierByNetworkId_ |
Returns the map that stores all Identifiers with their network IDs. More... | |
std::map< std::string, Identifier * > | identifierByString_ |
Map that stores all Identifiers with their names. More... | |
std::unordered_map< std::type_index, Identifier * > | identifierByTypeIndex_ |
Map that stores all Identifiers with their type_index. More... | |
std::set< Identifier * > | identifiers_ |
All identifiers. This is only used internally. More... | |
std::map< Identifiable *, std::list< const Identifier * > > | identifierTraceOfNewObject_ |
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 a consequence of this, e.g. More... | |
Identifier * | recordTraceForIdentifier_ |
The identifier for which we want to record the trace of identifiers during object creation. If null, no trace is recorded. More... | |
Static Private Attributes | |
static IdentifierManager * | singletonPtr_s = nullptr |
Friends | |
class | Singleton< IdentifierManager > |
Additional Inherited Members | |
Static Public Member Functions inherited from orxonox::Singleton< IdentifierManager > | |
static bool | exists () |
Tells whether the singleton has been created. More... | |
static IdentifierManager & | getInstance () |
Returns a reference to the singleton instance. More... | |
Protected Member Functions inherited from orxonox::Singleton< IdentifierManager > | |
Singleton () | |
Constructor sets the singleton instance pointer. More... | |
virtual | ~Singleton () |
Destructor resets the singleton instance pointer. More... | |
orxonox::IdentifierManager::IdentifierManager | ( | ) |
|
default |
|
privatedelete |
void orxonox::IdentifierManager::addIdentifier | ( | Identifier * | identifier | ) |
Registers the identifier in all maps of the IdentifierManager.
void orxonox::IdentifierManager::clearNetworkIDs | ( | ) |
Cleans the NetworkID map (needed on clients for correct initialization)
void orxonox::IdentifierManager::createClassHierarchy | ( | ) |
Creates the class-hierarchy by creating and destroying one object of each type.
void orxonox::IdentifierManager::createdObject | ( | Identifiable * | identifiable | ) |
Notifies the IdentifierManager about a newly created object while creating the class hierarchy.
void orxonox::IdentifierManager::destroyClassHierarchy | ( | ) |
Resets all Identifiers.
Identifier * orxonox::IdentifierManager::getIdentifierByID | ( | uint32_t | id | ) |
Returns the Identifier with a given network ID.
id | The network ID of the wanted Identifier |
Identifier * orxonox::IdentifierManager::getIdentifierByLowercaseString | ( | const std::string & | name | ) |
Returns the Identifier with a given name in lowercase.
name | The name of the wanted Identifier |
|
inline |
Returns the map that stores all Identifiers with their names in lowercase.
|
inline |
Returns the map that stores all Identifiers with their IDs.
Identifier * orxonox::IdentifierManager::getIdentifierByString | ( | const std::string & | name | ) |
Returns the Identifier with a given name.
name | The name of the wanted Identifier |
|
inline |
Returns the map that stores all Identifiers with their names.
Identifier * orxonox::IdentifierManager::getIdentifierByTypeInfo | ( | const std::type_info & | typeInfo | ) |
Returns the Identifier with a given typeid-name.
typeInfo | The type_info of the wanted Identifier |
|
inline |
Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents.
|
privatedelete |
void orxonox::IdentifierManager::removeIdentifier | ( | Identifier * | identifier | ) |
Unregisters the identifier from all maps of the IdentifierManager.
|
inlineprivate |
Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.
|
inlineprivate |
Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents.
void orxonox::IdentifierManager::verifyClassHierarchy | ( | const std::set< Identifier * > & | initializedIdentifiers | ) |
Verifies if the class hierarchy is consistent with the RTTI.
|
friend |
|
private |
Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)
|
private |
Map that stores all Identifiers with their names in lowercase.
|
private |
Returns the map that stores all Identifiers with their network IDs.
|
private |
Map that stores all Identifiers with their names.
|
private |
Map that stores all Identifiers with their type_index.
|
private |
All identifiers. This is only used internally.
|
private |
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 a consequence of this, e.g.
nested member objects).
|
private |
The identifier for which we want to record the trace of identifiers during object creation. If null, no trace is recorded.
|
staticprivate |