CommandTable< T > Class Template Reference

This class performs lookup of input to commands. More...

#include <CommandTable.h>

List of all members.

Public Member Functions

 CommandTable (const Binding *bindings, const unsigned int n)
 Constructs a CommandTable using the specified bindings table that is of the specified size.
virtual ~CommandTable ()
 Destructor, a noop.
const BindinggetBinding (const std::string &action)
 Performs a lookup on the specified word and returns the associated binding.
const ObjectgetObject (const std::string &action)
 Performs a lookup on the specified word and returns the associated object.
const std::vector
< std::string > & 
getCommandsVector () const
 Returns a list of known commands.


Detailed Description

template<typename T>
class CommandTable< T >

This class performs lookup of input to commands.

The lookup performs a binary search on the bindings table. It also checks for partial matches.

Definition at line 44 of file CommandTable.h.


Constructor & Destructor Documentation

template<typename T>
CommandTable< T >::CommandTable ( const Binding bindings,
const unsigned int  n 
) [inline]

Constructs a CommandTable using the specified bindings table that is of the specified size.

Definition at line 74 of file CommandTable.h.

template<typename T>
CommandTable< T >::~CommandTable (  )  [inline, virtual]

Destructor, a noop.

Definition at line 88 of file CommandTable.h.


Member Function Documentation

template<typename T>
const CommandBinding< T > * CommandTable< T >::getBinding ( const std::string &  action  )  [inline]

Performs a lookup on the specified word and returns the associated binding.

Definition at line 122 of file CommandTable.h.

template<typename T>
const CommandObject< T > * CommandTable< T >::getObject ( const std::string &  action  )  [inline]

Performs a lookup on the specified word and returns the associated object.

Definition at line 156 of file CommandTable.h.

template<typename T>
const std::vector< std::string > & CommandTable< T >::getCommandsVector (  )  const [inline]

Returns a list of known commands.

Definition at line 167 of file CommandTable.h.


Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo