Orxonox  0.0.5 Codename: Arcturus
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | Friends | List of all members
orxonox::IdentifierManager Class Reference

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/class/IdentifierManager.h>

Inheritance diagram for orxonox::IdentifierManager:
orxonox::Singleton< IdentifierManager >

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...
 
IdentifiergetIdentifierByID (uint32_t id)
 Returns the Identifier with a given network ID. More...
 
IdentifiergetIdentifierByLowercaseString (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...
 
IdentifiergetIdentifierByString (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...
 
IdentifiergetIdentifierByTypeInfo (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
 
IdentifierManageroperator= (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...
 
IdentifierrecordTraceForIdentifier_
 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 IdentifierManagersingletonPtr_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 IdentifierManagergetInstance ()
 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...
 

Constructor & Destructor Documentation

orxonox::IdentifierManager::IdentifierManager ( )
orxonox::IdentifierManager::~IdentifierManager ( )
default
orxonox::IdentifierManager::IdentifierManager ( const IdentifierManager )
privatedelete

Member Function Documentation

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.

Parameters
idThe network ID of the wanted Identifier
Returns
The Identifier
Identifier * orxonox::IdentifierManager::getIdentifierByLowercaseString ( const std::string &  name)

Returns the Identifier with a given name in lowercase.

Parameters
nameThe name of the wanted Identifier
Returns
The Identifier
const std::map<std::string, Identifier*>& orxonox::IdentifierManager::getIdentifierByLowercaseStringMap ( )
inline

Returns the map that stores all Identifiers with their names in lowercase.

const std::map<uint32_t, Identifier*>& orxonox::IdentifierManager::getIdentifierByNetworkIdMap ( )
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.

Parameters
nameThe name of the wanted Identifier
Returns
The Identifier
const std::map<std::string, Identifier*>& orxonox::IdentifierManager::getIdentifierByStringMap ( )
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.

Parameters
typeInfoThe type_info of the wanted Identifier
Returns
The Identifier
bool orxonox::IdentifierManager::isCreatingHierarchy ( )
inline

Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents.

IdentifierManager& orxonox::IdentifierManager::operator= ( const IdentifierManager )
privatedelete
void orxonox::IdentifierManager::removeIdentifier ( Identifier identifier)

Unregisters the identifier from all maps of the IdentifierManager.

void orxonox::IdentifierManager::startCreatingHierarchy ( )
inlineprivate

Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.

void orxonox::IdentifierManager::stopCreatingHierarchy ( )
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.

Friends And Related Function Documentation

friend class Singleton< IdentifierManager >
friend

Member Data Documentation

int orxonox::IdentifierManager::hierarchyCreatingCounter_s
private

Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading)

std::map<std::string, Identifier*> orxonox::IdentifierManager::identifierByLowercaseString_
private

Map that stores all Identifiers with their names in lowercase.

std::map<uint32_t, Identifier*> orxonox::IdentifierManager::identifierByNetworkId_
private

Returns the map that stores all Identifiers with their network IDs.

std::map<std::string, Identifier*> orxonox::IdentifierManager::identifierByString_
private

Map that stores all Identifiers with their names.

std::unordered_map<std::type_index, Identifier*> orxonox::IdentifierManager::identifierByTypeIndex_
private

Map that stores all Identifiers with their type_index.

std::set<Identifier*> orxonox::IdentifierManager::identifiers_
private

All identifiers. This is only used internally.

std::map<Identifiable*, std::list<const Identifier*> > orxonox::IdentifierManager::identifierTraceOfNewObject_
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).

Identifier* orxonox::IdentifierManager::recordTraceForIdentifier_
private

The identifier for which we want to record the trace of identifiers during object creation. If null, no trace is recorded.

IdentifierManager * orxonox::IdentifierManager::singletonPtr_s = nullptr
staticprivate

The documentation for this class was generated from the following files: