orxonox::Identifier Class Reference

The Identifier is used to identify the class of an object and to store informations about the class. More...

#include <src/core/Identifier.h>

Inheritance diagram for orxonox::Identifier:

orxonox::ClassIdentifier< T >

List of all members.

Public Member Functions

void addConfigValueContainer (const std::string &varname, ConfigValueContainer *container)
 Adds the ConfigValueContainer of a variable, given by the string of its name.
ConsoleCommandaddConsoleCommand (ConsoleCommand *command, bool bCreateShortcut)
 Adds a new console command of this class.
void addFactory (BaseFactory *factory)
 Sets the Factory.
void addXMLPortEventContainer (const std::string &eventname, XMLPortObjectContainer *container)
 Adds a new XMLPortEventContainer that attaches an event to this class.
void addXMLPortObjectContainer (const std::string &sectionname, XMLPortObjectContainer *container)
 Adds a new XMLPortObjectContainer that attaches an object to this class.
void addXMLPortParamContainer (const std::string &paramname, XMLPortParamContainer *container)
 Adds a new XMLPortParamContainer that loads a parameter of this class.
BaseObjectfabricate (BaseObject *creator)
 Creates an object of the type the Identifier belongs to.
const std::set< const
Identifier * > & 
getChildren () const
 Returns the children of the class the Identifier belongs to.
std::set< const Identifier * >
::const_iterator 
getChildrenBegin () const
 Returns the begin-iterator of the children-list.
std::set< const Identifier * >
::const_iterator 
getChildrenEnd () const
 Returns the end-iterator of the children-list.
ConfigValueContainergetConfigValueContainer (const std::string &varname)
 Returns the ConfigValueContainer of a variable, given by the string of its name.
const std::map< std::string,
ConfigValueContainer * > & 
getConfigValueMap () const
 Returns the map that stores all config values.
std::map< std::string,
ConfigValueContainer * >
::const_iterator 
getConfigValueMapBegin () const
 Returns a const_iterator to the beginning of the map that stores all config values.
std::map< std::string,
ConfigValueContainer * >
::const_iterator 
getConfigValueMapEnd () const
 Returns a const_iterator to the end of the map that stores all config values.
ConsoleCommandgetConsoleCommand (const std::string &name) const
 Returns the executor of a console command with given name.
const std::map< std::string,
ConsoleCommand * > & 
getConsoleCommandMap () const
 Returns the map that stores all console commands.
std::map< std::string,
ConsoleCommand * >
::const_iterator 
getConsoleCommandMapBegin () const
 Returns a const_iterator to the beginning of the map that stores all console commands.
std::map< std::string,
ConsoleCommand * >
::const_iterator 
getConsoleCommandMapEnd () const
 Returns a const_iterator to the end of the map that stores all console commands.
const std::set< const
Identifier * > & 
getDirectChildren () const
 Returns the direct children the class the Identifier belongs to.
std::set< const Identifier * >
::const_iterator 
getDirectChildrenBegin () const
 Returns the begin-iterator of the direct-children-list.
std::set< const Identifier * >
::const_iterator 
getDirectChildrenEnd () const
 Returns the end-iterator of the direct-children-list.
const std::set< const
Identifier * > & 
getDirectParents () const
 Returns the direct parents of the class the Identifier belongs to.
std::set< const Identifier * >
::const_iterator 
getDirectParentsBegin () const
 Returns the begin-iterator of the direct-parents-list.
std::set< const Identifier * >
::const_iterator 
getDirectParentsEnd () const
 Returns the end-iterator of the direct-parents-list.
ConfigValueContainergetLowercaseConfigValueContainer (const std::string &varname)
 Returns the ConfigValueContainer of a variable, given by the string of its name in lowercase.
const std::map< std::string,
ConfigValueContainer * > & 
getLowercaseConfigValueMap () const
 Returns the map that stores all config values with their names in lowercase.
std::map< std::string,
ConfigValueContainer * >
::const_iterator 
getLowercaseConfigValueMapBegin () const
 Returns a const_iterator to the beginning of the map that stores all config values with their names in lowercase.
std::map< std::string,
ConfigValueContainer * >
::const_iterator 
getLowercaseConfigValueMapEnd () const
 Returns a const_iterator to the end of the map that stores all config values with their names in lowercase.
ConsoleCommandgetLowercaseConsoleCommand (const std::string &name) const
 Returns the executor of a console command with given name in lowercase.
const std::map< std::string,
ConsoleCommand * > & 
getLowercaseConsoleCommandMap () const
 Returns the map that stores all console commands with their names in lowercase.
std::map< std::string,
ConsoleCommand * >
::const_iterator 
getLowercaseConsoleCommandMapBegin () const
 Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase.
std::map< std::string,
ConsoleCommand * >
::const_iterator 
getLowercaseConsoleCommandMapEnd () const
 Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase.
const std::stringgetName () const
 Returns the name of the class the Identifier belongs to.
const uint32_t getNetworkID () const
 Returns the network ID to identify a class through the network.
ObjectListBasegetObjects () const
 Returns the list of all existing objects of this class.
const std::set< const
Identifier * > & 
getParents () const
 Returns the parents of the class the Identifier belongs to.
std::set< const Identifier * >
::const_iterator 
getParentsBegin () const
 Returns the begin-iterator of the parents-list.
std::set< const Identifier * >
::const_iterator 
getParentsEnd () const
 Returns the end-iterator of the parents-list.
XMLPortObjectContainergetXMLPortEventContainer (const std::string &eventname)
 Returns a XMLPortEventContainer that attaches an event to this class.
const std::map< std::string,
XMLPortObjectContainer * > & 
getXMLPortEventMap () const
 Returns the map that stores all XMLPort events.
std::map< std::string,
XMLPortObjectContainer * >
::const_iterator 
getXMLPortEventMapBegin () const
 Returns a const_iterator to the beginning of the map that stores all XMLPort events.
std::map< std::string,
XMLPortObjectContainer * >
::const_iterator 
getXMLPortEventMapEnd () const
 Returns a const_iterator to the end of the map that stores all XMLPort events.
XMLPortObjectContainergetXMLPortObjectContainer (const std::string &sectionname)
 Returns a XMLPortObjectContainer that attaches an object to this class.
const std::map< std::string,
XMLPortObjectContainer * > & 
getXMLPortObjectMap () const
 Returns the map that stores all XMLPort objects.
std::map< std::string,
XMLPortObjectContainer * >
::const_iterator 
getXMLPortObjectMapBegin () const
 Returns a const_iterator to the beginning of the map that stores all XMLPort objects.
std::map< std::string,
XMLPortObjectContainer * >
::const_iterator 
getXMLPortObjectMapEnd () const
 Returns a const_iterator to the end of the map that stores all XMLPort objects.
XMLPortParamContainergetXMLPortParamContainer (const std::string &paramname)
 Returns a XMLPortParamContainer that loads a parameter of this class.
const std::map< std::string,
XMLPortParamContainer * > & 
getXMLPortParamMap () const
 Returns the map that stores all XMLPort params.
std::map< std::string,
XMLPortParamContainer * >
::const_iterator 
getXMLPortParamMapBegin () const
 Returns a const_iterator to the beginning of the map that stores all XMLPort params.
std::map< std::string,
XMLPortParamContainer * >
::const_iterator 
getXMLPortParamMapEnd () const
 Returns a const_iterator to the end of the map that stores all XMLPort params.
bool hasConfigValues () const
 Returns true if this class has at least one config value.
bool hasConsoleCommands () const
 Returns true if this class has at least one console command.
void initializeClassHierarchy (std::set< const Identifier * > *parents, bool bRootClass)
 Registers a class, which means that the name and the parents get stored.
bool isA (const Identifier *identifier) const
 Returns true, if the Identifier is at least of the given type.
bool isChildOf (const Identifier *identifier) const
 Returns true, if the assigned identifier is a child of the given identifier.
bool isDirectChildOf (const Identifier *identifier) const
 Returns true, if the assigned identifier is a direct child of the given identifier.
bool isDirectParentOf (const Identifier *identifier) const
 Returns true, if the assigned identifier is a direct parent of the given identifier.
bool isExactlyA (const Identifier *identifier) const
 Returns true, if the Identifier is exactly of the given type.
bool isLoadable () const
 Returns true if the class can be loaded through XML.
bool isParentOf (const Identifier *identifier) const
 Returns true, if the assigned identifier is a parent of the given identifier.
void setLoadable (bool bLoadable)
 Set the class to be loadable through XML or not.
void setName (const std::string &name)
 Sets the name of the class.
void setNetworkID (uint32_t id)
 Sets the network ID to a new value.
virtual void updateConfigValues (bool updateChildren=true) const =0

Static Public Member Functions

static void destroyAllIdentifiers ()
 Destroys all Identifiers. Called when exiting the program.
static const std::map
< std::string, Identifier * > & 
getIdentifierMap ()
 Returns the map that stores all Identifiers.
static std::map< std::string,
Identifier * >::const_iterator 
getIdentifierMapBegin ()
 Returns a const_iterator to the beginning of the map that stores all Identifiers.
static std::map< std::string,
Identifier * >::const_iterator 
getIdentifierMapEnd ()
 Returns a const_iterator to the end of the map that stores all Identifiers.
static const std::map
< std::string, Identifier * > & 
getLowercaseIdentifierMap ()
 Returns the map that stores all Identifiers with their names in lowercase.
static std::map< std::string,
Identifier * >::const_iterator 
getLowercaseIdentifierMapBegin ()
 Returns a const_iterator to the beginning of the map that stores all Identifiers with their names in lowercase.
static std::map< std::string,
Identifier * >::const_iterator 
getLowercaseIdentifierMapEnd ()
 Returns a const_iterator to the end of the map that stores all Identifiers with their names in lowercase.
static bool isCreatingHierarchy ()
 Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents.

Protected Member Functions

virtual void createSuperFunctionCaller () const =0
std::set< const Identifier * > & getChildrenIntern () const
 Returns the children of the class the Identifier belongs to.
std::set< const Identifier * > & getDirectChildrenIntern () const
 Returns the direct children of the class the Identifier belongs to.
 Identifier (const Identifier &identifier)
 Identifier ()
 Constructor: No factory, no object created, new ObjectList and a unique networkID.
virtual ~Identifier ()
 Destructor: Deletes the list containing the children.

Static Protected Member Functions

static std::map< std::string,
Identifier * > & 
getIdentifierMapIntern ()
 Returns the map that stores all Identifiers.
static IdentifiergetIdentifierSingleton (const std::string &name, Identifier *proposal)
 Returns an identifier by name and adds it if not available.
static std::map< std::string,
Identifier * > & 
getLowercaseIdentifierMapIntern ()
 Returns the map that stores all Identifiers with their names in lowercase.

Protected Attributes

ObjectListBaseobjects_
 The list of all objects of this class.

Private Member Functions

void initialize (std::set< const Identifier * > *parents)
 Initializes the Identifier with a list containing all parents of the class the Identifier belongs to.

Static Private Member Functions

static std::map< std::string,
Identifier * > & 
getTypeIDIdentifierMap ()
 Returns the identifier map with the names as received by typeid(). This is only used internally.
static void startCreatingHierarchy ()
 Increases the hierarchyCreatingCounter_s variable, causing all new objects to store their parents.
static void stopCreatingHierarchy ()
 Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents.

Private Attributes

bool bCreatedOneObject_
 True if at least one object of the given type was created (used to determine the need of storing the parents).
bool bHasConfigValues_
 True if this class has at least one assigned config value.
bool bHasConsoleCommands_
 True if this class has at least one assigned console command.
bool bLoadable_
 False = it's not permitted to load the object through XML.
bool bSetName_
 True if the name is set.
std::set< const Identifier * > * children_
 The children of the class the Identifier belongs to.
uint32_t classID_
 The network ID to identify a class through the network.
std::map< std::string,
ConfigValueContainer * > 
configValues_
 A map to link the string of configurable variables with their ConfigValueContainer.
std::map< std::string,
ConfigValueContainer * > 
configValues_LC_
 A map to link the string of configurable variables with their ConfigValueContainer.
std::map< std::string,
ConsoleCommand * > 
consoleCommands_
 All console commands of this class.
std::map< std::string,
ConsoleCommand * > 
consoleCommands_LC_
 All console commands of this class with their names in lowercase.
std::set< const Identifier * > * directChildren_
 The direct children of the class the Identifier belongs to.
std::set< const Identifier * > directParents_
 The direct parents of the class the Identifier belongs to.
BaseFactoryfactory_
 The Factory, able to create new objects of the given class (if available).
std::string name_
 The name of the class the Identifier belongs to.
std::set< const Identifier * > parents_
 The parents of the class the Identifier belongs to.
std::map< std::string,
XMLPortObjectContainer * > 
xmlportEventContainers_
 All events.
std::map< std::string,
XMLPortObjectContainer * > 
xmlportObjectContainers_
 All attachable objects.
std::map< std::string,
XMLPortParamContainer * > 
xmlportParamContainers_
 All loadable parameters.

Static Private Attributes

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

Friends

class Factory
class SubclassIdentifier


Detailed Description

The Identifier is used to identify the class of an object and to store informations about the class.

The Identifier contains all needed informations about the class it belongs to:

Every object has a pointer to the Identifier of its class. This allows the use isA(...), isExactlyA(...), isChildOf(...) and isParentOf(...).

You can't directly create an Identifier, it's just the base-class for ClassIdentifier.


Constructor & Destructor Documentation

orxonox::Identifier::Identifier (  )  [protected]

Constructor: No factory, no object created, new ObjectList and a unique networkID.

References bCreatedOneObject_, bHasConfigValues_, bHasConsoleCommands_, bLoadable_, bSetName_, children_, classID_, directChildren_, factory_, and objects_.

orxonox::Identifier::Identifier ( const Identifier identifier  )  [protected]

orxonox::Identifier::~Identifier (  )  [protected, virtual]

Destructor: Deletes the list containing the children.

References children_, configValues_, consoleCommands_, directChildren_, factory_, objects_, xmlportObjectContainers_, and xmlportParamContainers_.


Member Function Documentation

void orxonox::Identifier::addConfigValueContainer ( const std::string varname,
ConfigValueContainer container 
)

Adds the ConfigValueContainer of a variable, given by the string of its name.

Parameters:
varname The name of the variablee
container The container

References bHasConfigValues_, configValues_, configValues_LC_, COUT, orxonox::getLowercase(), and getName().

ConsoleCommand & orxonox::Identifier::addConsoleCommand ( ConsoleCommand command,
bool  bCreateShortcut 
)

Adds a new console command of this class.

Parameters:
executor The executor of the command
bCreateShortcut If this is true a shortcut gets created so you don't have to add the classname to access this command
Returns:
The executor of the command

References orxonox::CommandExecutor::addConsoleCommandShortcut(), bHasConsoleCommands_, consoleCommands_, consoleCommands_LC_, COUT, orxonox::getLowercase(), getName(), and orxonox::Executor::getName().

void orxonox::Identifier::addFactory ( BaseFactory factory  )  [inline]

Sets the Factory.

Parameters:
factory The factory to assign

void orxonox::Identifier::addXMLPortEventContainer ( const std::string eventname,
XMLPortObjectContainer container 
)

Adds a new XMLPortEventContainer that attaches an event to this class.

Parameters:
sectionname The name of the section that contains the event
container The container

References COUT, getName(), and xmlportEventContainers_.

Referenced by orxonox::BaseObject::XMLPort().

void orxonox::Identifier::addXMLPortObjectContainer ( const std::string sectionname,
XMLPortObjectContainer container 
)

Adds a new XMLPortObjectContainer that attaches an object to this class.

Parameters:
sectionname The name of the section that contains the attachable objects
container The container

References COUT, getName(), and xmlportObjectContainers_.

void orxonox::Identifier::addXMLPortParamContainer ( const std::string paramname,
XMLPortParamContainer container 
)

Adds a new XMLPortParamContainer that loads a parameter of this class.

Parameters:
paramname The name of the parameter
container The container

References COUT, getName(), and xmlportParamContainers_.

virtual void orxonox::Identifier::createSuperFunctionCaller (  )  const [protected, pure virtual]

void orxonox::Identifier::destroyAllIdentifiers (  )  [static]

Destroys all Identifiers. Called when exiting the program.

References getTypeIDIdentifierMap().

Referenced by orxonox::Core::~Core().

BaseObject * orxonox::Identifier::fabricate ( BaseObject creator  ) 

const std::set<const Identifier*>& orxonox::Identifier::getChildren (  )  const [inline]

Returns the children of the class the Identifier belongs to.

Returns:
The list of all children

std::set<const Identifier*>::const_iterator orxonox::Identifier::getChildrenBegin (  )  const [inline]

Returns the begin-iterator of the children-list.

Returns:
The begin-iterator

std::set<const Identifier*>::const_iterator orxonox::Identifier::getChildrenEnd (  )  const [inline]

Returns the end-iterator of the children-list.

Returns:
The end-iterator

std::set<const Identifier*>& orxonox::Identifier::getChildrenIntern (  )  const [inline, protected]

Returns the children of the class the Identifier belongs to.

Returns:
The list of all children

ConfigValueContainer * orxonox::Identifier::getConfigValueContainer ( const std::string varname  ) 

Returns the ConfigValueContainer of a variable, given by the string of its name.

Parameters:
varname The name of the variable
Returns:
The ConfigValueContainer

References configValues_.

const std::map<std::string, ConfigValueContainer*>& orxonox::Identifier::getConfigValueMap (  )  const [inline]

Returns the map that stores all config values.

Returns:
The const_iterator

std::map<std::string, ConfigValueContainer*>::const_iterator orxonox::Identifier::getConfigValueMapBegin (  )  const [inline]

Returns a const_iterator to the beginning of the map that stores all config values.

Returns:
The const_iterator

std::map<std::string, ConfigValueContainer*>::const_iterator orxonox::Identifier::getConfigValueMapEnd (  )  const [inline]

Returns a const_iterator to the end of the map that stores all config values.

Returns:
The const_iterator

ConsoleCommand * orxonox::Identifier::getConsoleCommand ( const std::string name  )  const

Returns the executor of a console command with given name.

name The name of the requested console command

Returns:
The executor of the requested console command

References consoleCommands_.

const std::map<std::string, ConsoleCommand*>& orxonox::Identifier::getConsoleCommandMap (  )  const [inline]

Returns the map that stores all console commands.

Returns:
The const_iterator

std::map<std::string, ConsoleCommand*>::const_iterator orxonox::Identifier::getConsoleCommandMapBegin (  )  const [inline]

Returns a const_iterator to the beginning of the map that stores all console commands.

Returns:
The const_iterator

std::map<std::string, ConsoleCommand*>::const_iterator orxonox::Identifier::getConsoleCommandMapEnd (  )  const [inline]

Returns a const_iterator to the end of the map that stores all console commands.

Returns:
The const_iterator

const std::set<const Identifier*>& orxonox::Identifier::getDirectChildren (  )  const [inline]

Returns the direct children the class the Identifier belongs to.

Returns:
The list of all direct children

Referenced by orxonox::ClassTreeMaskObjectIterator::create().

std::set<const Identifier*>::const_iterator orxonox::Identifier::getDirectChildrenBegin (  )  const [inline]

Returns the begin-iterator of the direct-children-list.

Returns:
The begin-iterator

Referenced by orxonox::ClassTreeMask::add(), and orxonox::ClassTreeMask::addSingle().

std::set<const Identifier*>::const_iterator orxonox::Identifier::getDirectChildrenEnd (  )  const [inline]

Returns the end-iterator of the direct-children-list.

Returns:
The end-iterator

Referenced by orxonox::ClassTreeMask::add(), and orxonox::ClassTreeMask::addSingle().

std::set<const Identifier*>& orxonox::Identifier::getDirectChildrenIntern (  )  const [inline, protected]

Returns the direct children of the class the Identifier belongs to.

Returns:
The list of all direct children

const std::set<const Identifier*>& orxonox::Identifier::getDirectParents (  )  const [inline]

Returns the direct parents of the class the Identifier belongs to.

Returns:
The list of all direct parents

std::set<const Identifier*>::const_iterator orxonox::Identifier::getDirectParentsBegin (  )  const [inline]

Returns the begin-iterator of the direct-parents-list.

Returns:
The begin-iterator

std::set<const Identifier*>::const_iterator orxonox::Identifier::getDirectParentsEnd (  )  const [inline]

Returns the end-iterator of the direct-parents-list.

Returns:
The end-iterator

static const std::map<std::string, Identifier*>& orxonox::Identifier::getIdentifierMap (  )  [inline, static]

Returns the map that stores all Identifiers.

Returns:
The map

References getIdentifierMapIntern().

Referenced by orxonox::ConfigFile::clean(), orxonox::autocompletion::configvalues(), getIdentifierMapBegin(), and getIdentifierMapEnd().

static std::map<std::string, Identifier*>::const_iterator orxonox::Identifier::getIdentifierMapBegin (  )  [inline, static]

Returns a const_iterator to the beginning of the map that stores all Identifiers.

Returns:
The const_iterator

References getIdentifierMap().

Referenced by orxonox::autocompletion::configvalueclasses(), and orxonox::ConfigFile::updateConfigValues().

static std::map<std::string, Identifier*>::const_iterator orxonox::Identifier::getIdentifierMapEnd (  )  [inline, static]

Returns a const_iterator to the end of the map that stores all Identifiers.

Returns:
The const_iterator

References getIdentifierMap().

Referenced by orxonox::ConfigFile::clean(), orxonox::autocompletion::configvalueclasses(), orxonox::autocompletion::configvalues(), and orxonox::ConfigFile::updateConfigValues().

std::map< std::string, Identifier * > & orxonox::Identifier::getIdentifierMapIntern (  )  [static, protected]

Returns the map that stores all Identifiers.

Returns:
The map

The map

Referenced by getIdentifierMap(), and setName().

Identifier * orxonox::Identifier::getIdentifierSingleton ( const std::string name,
Identifier proposal 
) [static, protected]

Returns an identifier by name and adds it if not available.

Parameters:
name The name of the identifier as typeid().name() suggests
proposal A pointer to a newly created identifier for the case of non existance in the map
Returns:
The identifier (unique instance)

References getTypeIDIdentifierMap().

ConfigValueContainer * orxonox::Identifier::getLowercaseConfigValueContainer ( const std::string varname  ) 

Returns the ConfigValueContainer of a variable, given by the string of its name in lowercase.

Parameters:
varname The name of the variable in lowercase
Returns:
The ConfigValueContainer

References configValues_LC_.

const std::map<std::string, ConfigValueContainer*>& orxonox::Identifier::getLowercaseConfigValueMap (  )  const [inline]

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

Returns:
The const_iterator

std::map<std::string, ConfigValueContainer*>::const_iterator orxonox::Identifier::getLowercaseConfigValueMapBegin (  )  const [inline]

Returns a const_iterator to the beginning of the map that stores all config values with their names in lowercase.

Returns:
The const_iterator

std::map<std::string, ConfigValueContainer*>::const_iterator orxonox::Identifier::getLowercaseConfigValueMapEnd (  )  const [inline]

Returns a const_iterator to the end of the map that stores all config values with their names in lowercase.

Returns:
The const_iterator

ConsoleCommand * orxonox::Identifier::getLowercaseConsoleCommand ( const std::string name  )  const

Returns the executor of a console command with given name in lowercase.

name The name of the requested console command in lowercae

Returns:
The executor of the requested console command

References consoleCommands_LC_.

const std::map<std::string, ConsoleCommand*>& orxonox::Identifier::getLowercaseConsoleCommandMap (  )  const [inline]

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

Returns:
The const_iterator

Referenced by orxonox::CommandExecutor::getPossibleCommand().

std::map<std::string, ConsoleCommand*>::const_iterator orxonox::Identifier::getLowercaseConsoleCommandMapBegin (  )  const [inline]

Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase.

Returns:
The const_iterator

Referenced by orxonox::CommandExecutor::createListOfPossibleFunctions().

std::map<std::string, ConsoleCommand*>::const_iterator orxonox::Identifier::getLowercaseConsoleCommandMapEnd (  )  const [inline]

Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase.

Returns:
The const_iterator

Referenced by orxonox::CommandExecutor::createListOfPossibleFunctions(), and orxonox::CommandExecutor::getPossibleCommand().

static const std::map<std::string, Identifier*>& orxonox::Identifier::getLowercaseIdentifierMap (  )  [inline, static]

static std::map<std::string, Identifier*>::const_iterator orxonox::Identifier::getLowercaseIdentifierMapBegin (  )  [inline, static]

Returns a const_iterator to the beginning of the map that stores all Identifiers with their names in lowercase.

Returns:
The const_iterator

References getLowercaseIdentifierMap().

Referenced by orxonox::CommandExecutor::createListOfPossibleIdentifiers().

static std::map<std::string, Identifier*>::const_iterator orxonox::Identifier::getLowercaseIdentifierMapEnd (  )  [inline, static]

Returns a const_iterator to the end of the map that stores all Identifiers with their names in lowercase.

Returns:
The const_iterator

References getLowercaseIdentifierMap().

Referenced by orxonox::config(), orxonox::autocompletion::configvalue(), orxonox::CommandExecutor::createListOfPossibleIdentifiers(), orxonox::CommandExecutor::getPossibleIdentifier(), and orxonox::tconfig().

std::map< std::string, Identifier * > & orxonox::Identifier::getLowercaseIdentifierMapIntern (  )  [static, protected]

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

Returns the map that stores all Identifiers.

Returns:
The map

The map

Referenced by getLowercaseIdentifierMap(), and setName().

const std::string& orxonox::Identifier::getName (  )  const [inline]

const uint32_t orxonox::Identifier::getNetworkID (  )  const [inline]

Returns the network ID to identify a class through the network.

Returns:
the network ID

Referenced by orxonox::Factory::add(), and orxonox::Synchronisable::getData().

ObjectListBase* orxonox::Identifier::getObjects (  )  const [inline]

Returns the list of all existing objects of this class.

Returns:
The list

const std::set<const Identifier*>& orxonox::Identifier::getParents (  )  const [inline]

Returns the parents of the class the Identifier belongs to.

Returns:
The list of all parents

std::set<const Identifier*>::const_iterator orxonox::Identifier::getParentsBegin (  )  const [inline]

Returns the begin-iterator of the parents-list.

Returns:
The begin-iterator

std::set<const Identifier*>::const_iterator orxonox::Identifier::getParentsEnd (  )  const [inline]

Returns the end-iterator of the parents-list.

Returns:
The end-iterator

std::map< std::string, Identifier * > & orxonox::Identifier::getTypeIDIdentifierMap (  )  [static, private]

Returns the identifier map with the names as received by typeid(). This is only used internally.

< The map to store all Identifiers.

Referenced by destroyAllIdentifiers(), and getIdentifierSingleton().

XMLPortObjectContainer * orxonox::Identifier::getXMLPortEventContainer ( const std::string eventname  ) 

Returns a XMLPortEventContainer that attaches an event to this class.

Parameters:
sectionname The name of the section that contains the event
Returns:
The container

References xmlportEventContainers_.

Referenced by orxonox::BaseObject::XMLPort().

const std::map<std::string, XMLPortObjectContainer*>& orxonox::Identifier::getXMLPortEventMap (  )  const [inline]

Returns the map that stores all XMLPort events.

Returns:
The const_iterator

std::map<std::string, XMLPortObjectContainer*>::const_iterator orxonox::Identifier::getXMLPortEventMapBegin (  )  const [inline]

Returns a const_iterator to the beginning of the map that stores all XMLPort events.

Returns:
The const_iterator

Referenced by orxonox::BaseObject::XMLPort().

std::map<std::string, XMLPortObjectContainer*>::const_iterator orxonox::Identifier::getXMLPortEventMapEnd (  )  const [inline]

Returns a const_iterator to the end of the map that stores all XMLPort events.

Returns:
The const_iterator

Referenced by orxonox::BaseObject::XMLPort().

XMLPortObjectContainer * orxonox::Identifier::getXMLPortObjectContainer ( const std::string sectionname  ) 

Returns a XMLPortObjectContainer that attaches an object to this class.

Parameters:
sectionname The name of the section that contains the attachable objects
Returns:
The container

References xmlportObjectContainers_.

const std::map<std::string, XMLPortObjectContainer*>& orxonox::Identifier::getXMLPortObjectMap (  )  const [inline]

Returns the map that stores all XMLPort objects.

Returns:
The const_iterator

std::map<std::string, XMLPortObjectContainer*>::const_iterator orxonox::Identifier::getXMLPortObjectMapBegin (  )  const [inline]

Returns a const_iterator to the beginning of the map that stores all XMLPort objects.

Returns:
The const_iterator

std::map<std::string, XMLPortObjectContainer*>::const_iterator orxonox::Identifier::getXMLPortObjectMapEnd (  )  const [inline]

Returns a const_iterator to the end of the map that stores all XMLPort objects.

Returns:
The const_iterator

XMLPortParamContainer * orxonox::Identifier::getXMLPortParamContainer ( const std::string paramname  ) 

Returns a XMLPortParamContainer that loads a parameter of this class.

Parameters:
paramname The name of the parameter
Returns:
The container

References xmlportParamContainers_.

const std::map<std::string, XMLPortParamContainer*>& orxonox::Identifier::getXMLPortParamMap (  )  const [inline]

Returns the map that stores all XMLPort params.

Returns:
The const_iterator

std::map<std::string, XMLPortParamContainer*>::const_iterator orxonox::Identifier::getXMLPortParamMapBegin (  )  const [inline]

Returns a const_iterator to the beginning of the map that stores all XMLPort params.

Returns:
The const_iterator

std::map<std::string, XMLPortParamContainer*>::const_iterator orxonox::Identifier::getXMLPortParamMapEnd (  )  const [inline]

Returns a const_iterator to the end of the map that stores all XMLPort params.

Returns:
The const_iterator

bool orxonox::Identifier::hasConfigValues (  )  const [inline]

Returns true if this class has at least one config value.

Returns:
True if this class has at least one config value

bool orxonox::Identifier::hasConsoleCommands (  )  const [inline]

Returns true if this class has at least one console command.

Returns:
True if this class has at least one console command

void orxonox::Identifier::initialize ( std::set< const Identifier * > *  parents  )  [private]

Initializes the Identifier with a list containing all parents of the class the Identifier belongs to.

Parameters:
parents A list containing all parents

References bCreatedOneObject_, COUT, directParents_, name_, and parents_.

Referenced by initializeClassHierarchy().

void orxonox::Identifier::initializeClassHierarchy ( std::set< const Identifier * > *  parents,
bool  bRootClass 
)

Registers a class, which means that the name and the parents get stored.

Parameters:
parents A list, containing the Identifiers of all parents of the class
bRootClass True if the class is either an Interface or the BaseObject itself

References bCreatedOneObject_, COUT, getName(), initialize(), and isCreatingHierarchy().

bool orxonox::Identifier::isA ( const Identifier identifier  )  const

bool orxonox::Identifier::isChildOf ( const Identifier identifier  )  const

Returns true, if the assigned identifier is a child of the given identifier.

Parameters:
identifier The identifier to compare with

References parents_.

Referenced by orxonox::OrxonoxClass::isChildOf().

static bool orxonox::Identifier::isCreatingHierarchy (  )  [inline, static]

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

Returns:
The status of the class-hierarchy creation

Referenced by orxonox::ConfigValueCallback< T >::call(), initializeClassHierarchy(), and orxonox::Synchronisable::~Synchronisable().

bool orxonox::Identifier::isDirectChildOf ( const Identifier identifier  )  const

Returns true, if the assigned identifier is a direct child of the given identifier.

Parameters:
identifier The identifier to compare with

References directParents_.

Referenced by orxonox::OrxonoxClass::isDirectChildOf().

bool orxonox::Identifier::isDirectParentOf ( const Identifier identifier  )  const

Returns true, if the assigned identifier is a direct parent of the given identifier.

Parameters:
identifier The identifier to compare with

References directChildren_.

Referenced by orxonox::OrxonoxClass::isDirectParentOf().

bool orxonox::Identifier::isExactlyA ( const Identifier identifier  )  const

Returns true, if the Identifier is exactly of the given type.

Parameters:
identifier The identifier to compare with

Referenced by orxonox::OrxonoxClass::isExactlyA().

bool orxonox::Identifier::isLoadable (  )  const [inline]

Returns true if the class can be loaded through XML.

Referenced by orxonox::XMLPortClassObjectContainer< T, O >::port().

bool orxonox::Identifier::isParentOf ( const Identifier identifier  )  const

Returns true, if the assigned identifier is a parent of the given identifier.

Parameters:
identifier The identifier to compare with

References children_.

Referenced by orxonox::OrxonoxClass::isParentOf().

void orxonox::Identifier::setLoadable ( bool  bLoadable  )  [inline]

Set the class to be loadable through XML or not.

void orxonox::Identifier::setName ( const std::string name  ) 

Sets the name of the class.

Parameters:
name The name

References bSetName_, getIdentifierMapIntern(), orxonox::getLowercase(), getLowercaseIdentifierMapIntern(), and name_.

void orxonox::Identifier::setNetworkID ( uint32_t  id  ) 

Sets the network ID to a new value.

Sets the network ID to a new value and changes the entry in the Factory.

Parameters:
id The new value
id The new network ID

References orxonox::Factory::changeNetworkID(), and classID_.

static void orxonox::Identifier::startCreatingHierarchy (  )  [inline, static, private]

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

References COUT.

static void orxonox::Identifier::stopCreatingHierarchy (  )  [inline, static, private]

Decreases the hierarchyCreatingCounter_s variable, causing the objects to stop storing their parents.

References COUT.

virtual void orxonox::Identifier::updateConfigValues ( bool  updateChildren = true  )  const [pure virtual]


Friends And Related Function Documentation

friend class Factory [friend]

friend class SubclassIdentifier [friend]


Member Data Documentation

True if at least one object of the given type was created (used to determine the need of storing the parents).

Referenced by Identifier(), initialize(), and initializeClassHierarchy().

True if this class has at least one assigned config value.

Referenced by addConfigValueContainer(), and Identifier().

True if this class has at least one assigned console command.

Referenced by addConsoleCommand(), and Identifier().

False = it's not permitted to load the object through XML.

Referenced by Identifier().

True if the name is set.

Referenced by Identifier(), and setName().

std::set<const Identifier*>* orxonox::Identifier::children_ [private]

The children of the class the Identifier belongs to.

Referenced by Identifier(), isParentOf(), and ~Identifier().

uint32_t orxonox::Identifier::classID_ [private]

The network ID to identify a class through the network.

Referenced by Identifier(), and setNetworkID().

A map to link the string of configurable variables with their ConfigValueContainer.

Referenced by addConfigValueContainer(), getConfigValueContainer(), and ~Identifier().

A map to link the string of configurable variables with their ConfigValueContainer.

Referenced by addConfigValueContainer(), and getLowercaseConfigValueContainer().

All console commands of this class.

Referenced by addConsoleCommand(), getConsoleCommand(), and ~Identifier().

All console commands of this class with their names in lowercase.

Referenced by addConsoleCommand(), and getLowercaseConsoleCommand().

std::set<const Identifier*>* orxonox::Identifier::directChildren_ [private]

The direct children of the class the Identifier belongs to.

Referenced by Identifier(), isDirectParentOf(), and ~Identifier().

std::set<const Identifier*> orxonox::Identifier::directParents_ [private]

The direct parents of the class the Identifier belongs to.

Referenced by initialize(), and isDirectChildOf().

The Factory, able to create new objects of the given class (if available).

Referenced by fabricate(), Identifier(), and ~Identifier().

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

The name of the class the Identifier belongs to.

Referenced by fabricate(), initialize(), and setName().

The list of all objects of this class.

Referenced by Identifier(), and ~Identifier().

std::set<const Identifier*> orxonox::Identifier::parents_ [private]

The parents of the class the Identifier belongs to.

Referenced by initialize(), isA(), and isChildOf().

All events.

Referenced by addXMLPortEventContainer(), and getXMLPortEventContainer().

All attachable objects.

Referenced by addXMLPortObjectContainer(), getXMLPortObjectContainer(), and ~Identifier().

All loadable parameters.

Referenced by addXMLPortParamContainer(), getXMLPortParamContainer(), and ~Identifier().


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

Generated on Tue Jul 28 16:22:37 2009 for Orxonox by  doxygen 1.5.6