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

A singleton that stores all existing ConsoleCommands. More...

#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/command/ConsoleCommandManager.h>

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

Public Member Functions

ConsoleCommandgetCommand (const std::string &name, bool bPrintError=false)
 Returns a command (shortcut) with given name. More...
 
ConsoleCommandgetCommand (const std::string &group, const std::string &name, bool bPrintError=false)
 Returns the command with given group an name. More...
 
ConsoleCommandgetCommandLC (const std::string &name, bool bPrintError=false)
 Returns a command (shortcut) with given name in lowercase. More...
 
ConsoleCommandgetCommandLC (const std::string &group, const std::string &name, bool bPrintError=false)
 Returns the command with given group an name in lowercase. More...
 
const std::map< std::string, std::map< std::string, ConsoleCommand * > > & getCommands ()
 Returns the map with all groups and commands. More...
 
const std::map< std::string, std::map< std::string, ConsoleCommand * > > & getCommandsLC ()
 Returns the map with all groups and commands in lowercase. More...
 
void registerCommand (ConsoleCommand *command)
 Registers a new command with the groups and names that are defined by ConsoleCommand::getNames(). More...
 
void registerCommand (const std::string &group, const std::string &name, ConsoleCommand *command)
 Registers a new command with given group an name by adding it to the command map. More...
 
void unregisterCommand (ConsoleCommand *command)
 Removes the command from the command map. More...
 

Private Attributes

std::map< std::string, std::map< std::string, ConsoleCommand * > > commandMap_
 
std::map< std::string, std::map< std::string, ConsoleCommand * > > commandMapLC_
 

Static Private Attributes

static ConsoleCommandManagersingletonPtr_s = nullptr
 

Friends

class Singleton< ConsoleCommandManager >
 

Additional Inherited Members

- Static Public Member Functions inherited from orxonox::Singleton< ConsoleCommandManager >
static bool exists ()
 Tells whether the singleton has been created. More...
 
static ConsoleCommandManagergetInstance ()
 Returns a reference to the singleton instance. More...
 
- Protected Member Functions inherited from orxonox::Singleton< ConsoleCommandManager >
 Singleton ()
 Constructor sets the singleton instance pointer. More...
 
virtual ~Singleton ()
 Destructor resets the singleton instance pointer. More...
 

Detailed Description

A singleton that stores all existing ConsoleCommands.

Member Function Documentation

ConsoleCommand* orxonox::ConsoleCommandManager::getCommand ( const std::string &  name,
bool  bPrintError = false 
)
inline

Returns a command (shortcut) with given name.

Parameters
nameThe name of the command shortcut
bPrintErrorIf true, an error is printed if the command doesn't exist
ConsoleCommand * orxonox::ConsoleCommandManager::getCommand ( const std::string &  group,
const std::string &  name,
bool  bPrintError = false 
)

Returns the command with given group an name.

Parameters
groupThe group of the requested command
nameThe group of the requested command
bPrintErrorIf true, an error is printed if the command doesn't exist
ConsoleCommand* orxonox::ConsoleCommandManager::getCommandLC ( const std::string &  name,
bool  bPrintError = false 
)
inline

Returns a command (shortcut) with given name in lowercase.

Parameters
nameThe lowercase name of the command shortcut
bPrintErrorIf true, an error is printed if the command doesn't exist
ConsoleCommand * orxonox::ConsoleCommandManager::getCommandLC ( const std::string &  group,
const std::string &  name,
bool  bPrintError = false 
)

Returns the command with given group an name in lowercase.

Parameters
groupThe group of the requested command in lowercase
nameThe group of the requested command in lowercase
bPrintErrorIf true, an error is printed if the command doesn't exist
const std::map<std::string, std::map<std::string, ConsoleCommand*> >& orxonox::ConsoleCommandManager::getCommands ( )
inline

Returns the map with all groups and commands.

const std::map<std::string, std::map<std::string, ConsoleCommand*> >& orxonox::ConsoleCommandManager::getCommandsLC ( )
inline

Returns the map with all groups and commands in lowercase.

void orxonox::ConsoleCommandManager::registerCommand ( ConsoleCommand command)

Registers a new command with the groups and names that are defined by ConsoleCommand::getNames().

void orxonox::ConsoleCommandManager::registerCommand ( const std::string &  group,
const std::string &  name,
ConsoleCommand command 
)

Registers a new command with given group an name by adding it to the command map.

void orxonox::ConsoleCommandManager::unregisterCommand ( ConsoleCommand command)

Removes the command from the command map.

Friends And Related Function Documentation

friend class Singleton< ConsoleCommandManager >
friend

Member Data Documentation

std::map<std::string, std::map<std::string, ConsoleCommand*> > orxonox::ConsoleCommandManager::commandMap_
private
std::map<std::string, std::map<std::string, ConsoleCommand*> > orxonox::ConsoleCommandManager::commandMapLC_
private
ConsoleCommandManager * orxonox::ConsoleCommandManager::singletonPtr_s = nullptr
staticprivate

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