Orxonox
0.0.5 Codename: Arcturus
|
A singleton that stores all existing ConsoleCommands. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/command/ConsoleCommandManager.h>
Public Member Functions | |
ConsoleCommand * | getCommand (const std::string &name, bool bPrintError=false) |
Returns a command (shortcut) with given name. More... | |
ConsoleCommand * | getCommand (const std::string &group, const std::string &name, bool bPrintError=false) |
Returns the command with given group an name. More... | |
ConsoleCommand * | getCommandLC (const std::string &name, bool bPrintError=false) |
Returns a command (shortcut) with given name in lowercase. More... | |
ConsoleCommand * | getCommandLC (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 ConsoleCommandManager * | singletonPtr_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 ConsoleCommandManager & | getInstance () |
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... | |
A singleton that stores all existing ConsoleCommands.
|
inline |
Returns a command (shortcut) with given name.
name | The name of the command shortcut |
bPrintError | If 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.
group | The group of the requested command |
name | The group of the requested command |
bPrintError | If true, an error is printed if the command doesn't exist |
|
inline |
Returns a command (shortcut) with given name in lowercase.
name | The lowercase name of the command shortcut |
bPrintError | If 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.
group | The group of the requested command in lowercase |
name | The group of the requested command in lowercase |
bPrintError | If true, an error is printed if the command doesn't exist |
|
inline |
Returns the map with all groups and commands.
|
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.
|
friend |
|
private |
|
private |
|
staticprivate |