orxonox::CommandExecutor Class Reference

#include <src/core/CommandExecutor.h>

List of all members.

Static Public Member Functions

static ConsoleCommandaddConsoleCommandShortcut (ConsoleCommand *command, bool bDeleteAtExit=false)
static std::string complete (const std::string &command)
static void destroyExternalCommands ()
static CommandEvaluation evaluate (const std::string &command)
static bool execute (const std::string &command, bool useTcl=true)
static ConsoleCommandgetConsoleCommandShortcut (const std::string &name)
 Returns the executor of a console command shortcut with given name.
static const std::map
< std::string, ConsoleCommand * > & 
getConsoleCommandShortcutMap ()
 Returns the map that stores all console commands.
static std::map< std::string,
ConsoleCommand * >
::const_iterator 
getConsoleCommandShortcutMapBegin ()
 Returns a const_iterator to the beginning of the map that stores all console commands.
static std::map< std::string,
ConsoleCommand * >
::const_iterator 
getConsoleCommandShortcutMapEnd ()
 Returns a const_iterator to the end of the map that stores all console commands.
static const CommandEvaluationgetLastEvaluation ()
static ConsoleCommandgetLowercaseConsoleCommandShortcut (const std::string &name)
 Returns the executor of a console command shortcut with given name in lowercase.
static const std::map
< std::string, ConsoleCommand * > & 
getLowercaseConsoleCommandShortcutMap ()
 Returns the map that stores all console commands with their names in lowercase.
static std::map< std::string,
ConsoleCommand * >
::const_iterator 
getLowercaseConsoleCommandShortcutMapBegin ()
 Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase.
static std::map< std::string,
ConsoleCommand * >
::const_iterator 
getLowercaseConsoleCommandShortcutMapEnd ()
 Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase.
static MultiType getReturnValue ()
static std::string getReturnValueString ()
static std::string hint (const std::string &command)

Private Member Functions

 CommandExecutor (const CommandExecutor &other)
 CommandExecutor ()
 ~CommandExecutor ()

Static Private Member Functions

static unsigned int argumentsFinished ()
static unsigned int argumentsGiven ()
static void createArgumentCompletionList (ConsoleCommand *command, unsigned int param)
static void createListOfPossibleArguments (const std::string &fragment, ConsoleCommand *command, unsigned int param)
static void createListOfPossibleFunctions (const std::string &fragment, Identifier *identifier=0)
static void createListOfPossibleIdentifiers (const std::string &fragment)
static bool enoughArgumentsGiven (ConsoleCommand *command)
static std::string getArgument (unsigned int index)
static std::string getCommonBegin (const ArgumentCompletionList &list)
static std::string getCommonBegin (const std::list< std::pair< const std::string *, const std::string * > > &list)
static CommandEvaluationgetEvaluation ()
static CommandExecutorgetInstance ()
static std::string getLastArgument ()
static std::string getPossibleArgument (const std::string &name, ConsoleCommand *command, unsigned int param)
static ConsoleCommandgetPossibleCommand (const std::string &name, Identifier *identifier=0)
static IdentifiergetPossibleIdentifier (const std::string &name)
static void parse (const std::string &command, bool bInitialize=true)
static void parseIfNeeded (const std::string &command)

Private Attributes

std::set< ConsoleCommand * > consoleCommandExternals_
std::map< std::string,
ConsoleCommand * > 
consoleCommandShortcuts_
std::map< std::string,
ConsoleCommand * > 
consoleCommandShortcuts_LC_
CommandEvaluation evaluation_


Constructor & Destructor Documentation

orxonox::CommandExecutor::CommandExecutor (  )  [inline, private]

orxonox::CommandExecutor::CommandExecutor ( const CommandExecutor other  )  [private]

orxonox::CommandExecutor::~CommandExecutor (  )  [inline, private]


Member Function Documentation

ConsoleCommand & orxonox::CommandExecutor::addConsoleCommandShortcut ( ConsoleCommand command,
bool  bDeleteAtExit = false 
) [static]

unsigned int orxonox::CommandExecutor::argumentsFinished (  )  [static, private]

References argumentsGiven().

unsigned int orxonox::CommandExecutor::argumentsGiven (  )  [static, private]

std::string orxonox::CommandExecutor::complete ( const std::string command  )  [static]

void orxonox::CommandExecutor::createArgumentCompletionList ( ConsoleCommand command,
unsigned int  param 
) [static, private]

void orxonox::CommandExecutor::createListOfPossibleArguments ( const std::string fragment,
ConsoleCommand command,
unsigned int  param 
) [static, private]

void orxonox::CommandExecutor::createListOfPossibleFunctions ( const std::string fragment,
Identifier identifier = 0 
) [static, private]

void orxonox::CommandExecutor::createListOfPossibleIdentifiers ( const std::string fragment  )  [static, private]

void orxonox::CommandExecutor::destroyExternalCommands (  )  [static]

bool orxonox::CommandExecutor::enoughArgumentsGiven ( ConsoleCommand command  )  [static, private]

CommandEvaluation orxonox::CommandExecutor::evaluate ( const std::string command  )  [static]

bool orxonox::CommandExecutor::execute ( const std::string command,
bool  useTcl = true 
) [static]

std::string orxonox::CommandExecutor::getArgument ( unsigned int  index  )  [static, private]

std::string orxonox::CommandExecutor::getCommonBegin ( const ArgumentCompletionList list  )  [static, private]

std::string orxonox::CommandExecutor::getCommonBegin ( const std::list< std::pair< const std::string *, const std::string * > > &  list  )  [static, private]

Referenced by parse().

ConsoleCommand * orxonox::CommandExecutor::getConsoleCommandShortcut ( const std::string name  )  [static]

Returns the executor of a console command shortcut with given name.

name The name of the requested console command shortcut

Returns:
The executor of the requested console command shortcut

References consoleCommandShortcuts_, and getInstance().

static const std::map<std::string, ConsoleCommand*>& orxonox::CommandExecutor::getConsoleCommandShortcutMap (  )  [inline, static]

Returns the map that stores all console commands.

Returns:
The const_iterator

References consoleCommandShortcuts_, and getInstance().

static std::map<std::string, ConsoleCommand*>::const_iterator orxonox::CommandExecutor::getConsoleCommandShortcutMapBegin (  )  [inline, static]

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

Returns:
The const_iterator

References consoleCommandShortcuts_, and getInstance().

static std::map<std::string, ConsoleCommand*>::const_iterator orxonox::CommandExecutor::getConsoleCommandShortcutMapEnd (  )  [inline, static]

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

Returns:
The const_iterator

References consoleCommandShortcuts_, and getInstance().

CommandEvaluation & orxonox::CommandExecutor::getEvaluation (  )  [static, private]

CommandExecutor & orxonox::CommandExecutor::getInstance (  )  [static, private]

std::string orxonox::CommandExecutor::getLastArgument (  )  [static, private]

References argumentsGiven(), and getArgument().

Referenced by parse().

const CommandEvaluation & orxonox::CommandExecutor::getLastEvaluation (  )  [static]

ConsoleCommand * orxonox::CommandExecutor::getLowercaseConsoleCommandShortcut ( const std::string name  )  [static]

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

name The name of the requested console command shortcut in lowercase

Returns:
The executor of the requested console command shortcut

References consoleCommandShortcuts_LC_, and getInstance().

static const std::map<std::string, ConsoleCommand*>& orxonox::CommandExecutor::getLowercaseConsoleCommandShortcutMap (  )  [inline, static]

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

Returns:
The const_iterator

References consoleCommandShortcuts_LC_, and getInstance().

Referenced by getPossibleCommand().

static std::map<std::string, ConsoleCommand*>::const_iterator orxonox::CommandExecutor::getLowercaseConsoleCommandShortcutMapBegin (  )  [inline, static]

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

Returns:
The const_iterator

References consoleCommandShortcuts_LC_, and getInstance().

Referenced by createListOfPossibleFunctions().

static std::map<std::string, ConsoleCommand*>::const_iterator orxonox::CommandExecutor::getLowercaseConsoleCommandShortcutMapEnd (  )  [inline, static]

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

Returns:
The const_iterator

References consoleCommandShortcuts_LC_, and getInstance().

Referenced by createListOfPossibleFunctions(), and getPossibleCommand().

std::string orxonox::CommandExecutor::getPossibleArgument ( const std::string name,
ConsoleCommand command,
unsigned int  param 
) [static, private]

ConsoleCommand * orxonox::CommandExecutor::getPossibleCommand ( const std::string name,
Identifier identifier = 0 
) [static, private]

Identifier * orxonox::CommandExecutor::getPossibleIdentifier ( const std::string name  )  [static, private]

MultiType orxonox::CommandExecutor::getReturnValue (  )  [static]

std::string orxonox::CommandExecutor::getReturnValueString (  )  [static]

std::string orxonox::CommandExecutor::hint ( const std::string command  )  [static]

void orxonox::CommandExecutor::parse ( const std::string command,
bool  bInitialize = true 
) [static, private]

void orxonox::CommandExecutor::parseIfNeeded ( const std::string command  )  [static, private]


Member Data Documentation

Referenced by getEvaluation(), and getLastEvaluation().


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

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