VR-Forces 4.3.1 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes
DtConsoleCommandManager Class Reference

This is a class which maintains a list of string command names and the callback functions that are to be called in response to these commands. More...

Inheritance diagram for DtConsoleCommandManager:
Inheritance graph
[legend]

Classes

class  DtHelpConsoleCommand
class  DtNotifyLevelCommand

Public Member Functions

 DtConsoleCommandManager ()
virtual ~DtConsoleCommandManager ()
virtual void addCommand (DtString commandString, DtConsoleCommand *command)
 Register a new command with the manager.
virtual void removeCommand (DtString commandString)
 Remove a command from the manager.
virtual void removeCommand (DtConsoleCommand *command)
 Removes all references to the specified command.
virtual bool runCommand (DtString consoleString)
 Pass in the string entered on the console to run the command (if any) contained in it.
virtual DtString helpText (const DtString &parameters) const
virtual void addAlias (DtString aliasString, DtConsoleCommand *command)
 Adds an additional string which will invoke a command already registered with addCommand().
virtual void addAlias (DtString aliasString, DtString commandString)
 Adds an additional string which will invoke a command already registered with addCommand().

Static Public Member Functions

static void cleanup ()
 Cleans up global command manager.
static DtConsoleCommandManagerglobalConsoleCommandManager ()

Public Attributes

boost::signal< void()> signal_globalCommandManagerToBeDestroyed

Protected Types

typedef std::map< DtString,
DtConsoleCommand * > 
DtConsoleCommandMap

Protected Member Functions

virtual void removeReferencesFromMap (DtConsoleCommandMap &commandMap, DtConsoleCommand *command)
 Used internally. Removes all items that refer to command from commandMap.

Protected Attributes

DtConsoleCommandMap myCommandMap
DtConsoleCommandMap myAliasMap
DtHelpConsoleCommandmyHelpCommand

Static Protected Attributes

static DtConsoleCommandManagertheConsoleCommandManager

Private Member Functions

 DtConsoleCommandManager (const DtConsoleCommandManager &orig)
 Not implemented.
DtConsoleCommandManageroperator= (const DtConsoleCommandManager &orig)
 Not implemented.

Detailed Description

This is a class which maintains a list of string command names and the callback functions that are to be called in response to these commands.

An application that reads a command string from the user may pass this string to this manager and it will dispatch to the appropriate registered functions.

Member Typedef Documentation

Constructor & Destructor Documentation

DtConsoleCommandManager::DtConsoleCommandManager ( const DtConsoleCommandManager orig)
private

Not implemented.

DtConsoleCommandManager::DtConsoleCommandManager ( )
virtual DtConsoleCommandManager::~DtConsoleCommandManager ( )
virtual

Member Function Documentation

DtConsoleCommandManager& DtConsoleCommandManager::operator= ( const DtConsoleCommandManager orig)
private

Not implemented.

virtual void DtConsoleCommandManager::addCommand ( DtString  commandString,
DtConsoleCommand command 
)
virtual

Register a new command with the manager.

The userData pointer will be passed into the command function when it is called. Case of commandString will be ignored. Takes ownership of command and will destroye the command when the class is destroyed

virtual void DtConsoleCommandManager::addAlias ( DtString  aliasString,
DtConsoleCommand command 
)
virtual

Adds an additional string which will invoke a command already registered with addCommand().

virtual void DtConsoleCommandManager::addAlias ( DtString  aliasString,
DtString  commandString 
)
virtual

Adds an additional string which will invoke a command already registered with addCommand().

virtual void DtConsoleCommandManager::removeCommand ( DtString  commandString)
virtual

Remove a command from the manager.

Case of commandString will be ignored.

virtual void DtConsoleCommandManager::removeCommand ( DtConsoleCommand command)
virtual

Removes all references to the specified command.

virtual bool DtConsoleCommandManager::runCommand ( DtString  consoleString)
virtual

Pass in the string entered on the console to run the command (if any) contained in it.

Case is ignored.

Returns
True if a command was invoked.

Reimplemented in MAKVRinTerra::DtFeaturesDebugger.

virtual DtString DtConsoleCommandManager::helpText ( const DtString parameters) const
virtual
Returns
The help string, based on the current commands.

Reimplemented in MAKVRinTerra::DtFeaturesDebugger.

static void DtConsoleCommandManager::cleanup ( )
static

Cleans up global command manager.

static DtConsoleCommandManager* DtConsoleCommandManager::globalConsoleCommandManager ( )
static
Returns
A pointer to the global console command manager.
virtual void DtConsoleCommandManager::removeReferencesFromMap ( DtConsoleCommandMap commandMap,
DtConsoleCommand command 
)
protectedvirtual

Used internally. Removes all items that refer to command from commandMap.

Member Data Documentation

boost::signal<void ()> DtConsoleCommandManager::signal_globalCommandManagerToBeDestroyed
DtConsoleCommandMap DtConsoleCommandManager::myCommandMap
protected
DtConsoleCommandMap DtConsoleCommandManager::myAliasMap
protected
DtHelpConsoleCommand* DtConsoleCommandManager::myHelpCommand
protected
DtConsoleCommandManager* DtConsoleCommandManager::theConsoleCommandManager
staticprotected

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

Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)