CommandObject< T > Class Template Reference

This template defines a function binding. More...

#include <CommandObject.h>

Inheritance diagram for CommandObject< T >:

Inheritance graph
[legend]

List of all members.

Public Types

typedef void(T::* CommandFunction )(const std::string &argument)
 The type of the function to bind on.

Public Member Functions

 CommandObject (const char *name, CommandFunction command, bool fullname=false)
 Construct a CommandObject, binding the specified function to the specified name.
 ~CommandObject ()
 Destructor, a noop.
void Run (T *owner, const std::string &argument) const
 Execute the stored function with the specified owner and argument.
const char * getName () const
 Return the name of the bound function.
bool fullName () const
 Whether, when performing a lookup on this function, only the full alias should be allowed.

Protected Attributes

const char * m_name
 The name of the bound function.
CommandFunction m_command
 The bound function.
bool m_fullName
 Whether only the full alias should be allowed.


Detailed Description

template<class T>
class CommandObject< T >

This template defines a function binding.

A binding is made to a name, allowing some sort of reflection later on.

Definition at line 39 of file CommandObject.h.


Member Typedef Documentation

template<class T>
typedef void(T::* CommandObject< T >::CommandFunction)(const std::string &argument)

The type of the function to bind on.

Reimplemented in CommandInfoObject< T >.

Definition at line 42 of file CommandObject.h.


Constructor & Destructor Documentation

template<class T>
CommandObject< T >::CommandObject ( const char *  name,
CommandFunction  command,
bool  fullname = false 
) [inline]

Construct a CommandObject, binding the specified function to the specified name.

Definition at line 79 of file CommandObject.h.

template<class T>
CommandObject< T >::~CommandObject (  )  [inline]

Destructor, a noop.

Definition at line 88 of file CommandObject.h.


Member Function Documentation

template<class T>
void CommandObject< T >::Run ( T *  owner,
const std::string &  argument 
) const [inline]

Execute the stored function with the specified owner and argument.

Definition at line 93 of file CommandObject.h.

template<class T>
const char * CommandObject< T >::getName (  )  const [inline]

Return the name of the bound function.

Definition at line 67 of file CommandObject.h.

template<class T>
bool CommandObject< T >::fullName (  )  const [inline]

Whether, when performing a lookup on this function, only the full alias should be allowed.

Definition at line 73 of file CommandObject.h.


Member Data Documentation

template<class T>
const char* CommandObject< T >::m_name [protected]

The name of the bound function.

Definition at line 61 of file CommandObject.h.

template<class T>
CommandFunction CommandObject< T >::m_command [protected]

The bound function.

Definition at line 62 of file CommandObject.h.

template<class T>
bool CommandObject< T >::m_fullName [protected]

Whether only the full alias should be allowed.

Definition at line 63 of file CommandObject.h.


Generated for UnsignedByte by  doxygen 1.5.3
SourceForge.net Logo