CmdProto Class Reference
[Kernel Module]

#include <cmdproto.h>

Inheritance diagram for CmdProto:

HashNode ListNode< HashNode > CmdProtoNative LuaCmdProto

List of all members.


Detailed Description

An CmdProto object holds the prototype description for an Cmd object and can construct Cmd objects based on the prototype description "blue print".

The prototype description is given to the CmdProto constructor as a string of the format

"outargs_name_inargs"

"outargs" is a list of characters describing number and datatypes of output arguments, "inargs" describes the input args in the same way. "name" is the name of the command.

The following datatypes are defined:

Examples of prototype descriptions:

		v_rotate_fff    - name is 'rotate', no output args, 3 float input args,
		v_set_si        - name is 'set', no output args, one string and one int input arg
		fff_getrotate_v - 3 float output args, no input arg, name is 'getrotate'
	

Public Member Functions

 CmdProto (const char *proto_def, fourcc_t id)
 CmdProto (const CmdProto &rhs)
virtual ~CmdProto ()
virtual bool Dispatch (void *, Cmd *)=0
 Executes a command on the provided object.
fourcc_t GetId () const
int GetInArgsCount () const
int GetOutArgsCount () const
int GetNumArgs () const
const char * GetProtoDef () const
CmdNewCmd ()
void RelCmd (Cmd *cmd)

Private Attributes

fourcc_t fourcc
byte_t in_args_count
byte_t out_args_count
bool cmd_locked
Cmdcmd_template
string proto_def

Constructor & Destructor Documentation

CmdProto::CmdProto ( const char *  proto_def,
fourcc_t  id 
)

Constructor.

CmdProto::CmdProto ( const CmdProto rhs  ) 

Copy constructor.

CmdProto::~CmdProto (  )  [virtual]

Destructor.


Member Function Documentation

virtual bool CmdProto::Dispatch ( void *  ,
Cmd  
) [pure virtual]

Executes a command on the provided object.

Implemented in CmdProtoNative, and LuaCmdProto.

fourcc_t CmdProto::GetId (  )  const [inline]

Gets fourcc code.

int CmdProto::GetInArgsCount (  )  const [inline]

Gets number of input args.

int CmdProto::GetOutArgsCount (  )  const [inline]

Gets number of output args.

int CmdProto::GetNumArgs (  )  const [inline]

Gets overall number of args.

const char * CmdProto::GetProtoDef (  )  const [inline]

Gets the prototype string.

Cmd * CmdProto::NewCmd (  ) 

Create a new cmd object from the internal template object. Optimization: normally just returns the template object (if nobody else uses it), instead of creating a new object.

IMPORTANT: the CmdProto::RelCmd() method MUST be used to release the Cmd object!!!

void CmdProto::RelCmd ( Cmd cmd  ) 

Release a Cmd object created with CmdProto::NewCmd()


Member Data Documentation

fourcc_t CmdProto::fourcc [private]

byte_t CmdProto::in_args_count [private]

byte_t CmdProto::out_args_count [private]

bool CmdProto::cmd_locked [private]

Cmd* CmdProto::cmd_template [private]

string CmdProto::proto_def [private]


The documentation for this class was generated from the following files:
Generated on Sat Oct 20 14:47:31 2007 for Dark Oberon by  doxygen 1.5.3