ArServerHandlerCommands Class Reference

#include <ArServerHandlerCommands.h>

List of all members.


Detailed Description

You can add commands with addCommand and addStringCommand, you can get the list of commands by requesting the data "listCommands" and "listStringCommands".
Examples:

serverDemo.cpp, and simpleServerExample.cpp.


Public Member Functions

bool addCommand (const char *name, const char *description, ArFunctor *functor, const char *commandGroup=NULL)
 Adds a command with no arguments.
bool addStringCommand (const char *name, const char *description, ArFunctor1< ArArgumentBuilder * > *functor, const char *commandGroup=NULL)
 Adds a command that takes a string argument.
 ArServerHandlerCommands (ArServerBase *server)
 Constructor.
const char * getPrefix (void)
 Gets the prefix.
void netListCommands (ArServerClient *client, ArNetPacket *packet)
 The function that lists the commands.
void netListStringCommands (ArServerClient *client, ArNetPacket *packet)
 The function that lists the string commands.
void setPrefix (const char *prefix)
 Sets a prefix for commands.
virtual ~ArServerHandlerCommands ()
 Destructor.

Protected Member Functions

void netParseCommand (ArServerClient *client, ArNetPacket *packet, ArFunctor *functor)
void netParseStringCommand (ArServerClient *client, ArNetPacket *packet, ArFunctor1< ArArgumentBuilder * > *functor)

Protected Attributes

std::list< std::string > myCommandDescriptions
std::list< std::string > myCommands
std::list< ArFunctor3< ArServerClient *,
ArNetPacket *, ArFunctor * > * > 
myFunctors
ArFunctor2C< ArServerHandlerCommands,
ArServerClient *, ArNetPacket * > 
myNetListCommandsCB
ArFunctor2C< ArServerHandlerCommands,
ArServerClient *, ArNetPacket * > 
myNetListStringCommandsCB
std::string myPrefix
ArServerBasemyServer
std::list< std::string > myStringCommandDescriptions
std::list< std::string > myStringCommands
std::list< ArFunctor3< ArServerClient *,
ArNetPacket *, ArFunctor1<
ArArgumentBuilder * > * > * > 
myStringFunctors


Constructor & Destructor Documentation

ArServerHandlerCommands::ArServerHandlerCommands ( ArServerBase server  ) 

Constructor.

ArServerHandlerCommands::~ArServerHandlerCommands (  )  [virtual]

Destructor.


Member Function Documentation

bool ArServerHandlerCommands::addCommand ( const char *  name,
const char *  description,
ArFunctor functor,
const char *  commandGroup = NULL 
)

Adds a command with no arguments.

Parameters:
name the name of the command to add
description the description used for this command
functor the functor to call
commandGroup the command group this should be in, if NULL defaults to CustomCommands

bool ArServerHandlerCommands::addStringCommand ( const char *  name,
const char *  description,
ArFunctor1< ArArgumentBuilder * > *  functor,
const char *  commandGroup = NULL 
)

Adds a command that takes a string argument.

Parameters:
name the name of the command to add
description the description used for this command
functor the functor to call (takes an argument builder)
commandGroup the command group this should be in, if NULL defaults to CustomCommands

const char * ArServerHandlerCommands::getPrefix ( void   ) 

Gets the prefix.

void ArServerHandlerCommands::netListCommands ( ArServerClient client,
ArNetPacket packet 
)

The function that lists the commands.

void ArServerHandlerCommands::netListStringCommands ( ArServerClient client,
ArNetPacket packet 
)

The function that lists the string commands.

void ArServerHandlerCommands::netParseCommand ( ArServerClient client,
ArNetPacket packet,
ArFunctor functor 
) [protected]

void ArServerHandlerCommands::netParseStringCommand ( ArServerClient client,
ArNetPacket packet,
ArFunctor1< ArArgumentBuilder * > *  functor 
) [protected]

void ArServerHandlerCommands::setPrefix ( const char *  prefix  ) 

Sets a prefix for commands.


Member Data Documentation

std::list<std::string> ArServerHandlerCommands::myCommandDescriptions [protected]

std::list<std::string> ArServerHandlerCommands::myCommands [protected]

std::list<ArFunctor3<ArServerClient *, ArNetPacket *, ArFunctor *> *> ArServerHandlerCommands::myFunctors [protected]

ArFunctor2C<ArServerHandlerCommands, ArServerClient *, ArNetPacket *> ArServerHandlerCommands::myNetListCommandsCB [protected]

ArFunctor2C<ArServerHandlerCommands, ArServerClient *, ArNetPacket *> ArServerHandlerCommands::myNetListStringCommandsCB [protected]

std::string ArServerHandlerCommands::myPrefix [protected]

ArServerBase* ArServerHandlerCommands::myServer [protected]

std::list<std::string> ArServerHandlerCommands::myStringCommandDescriptions [protected]

std::list<std::string> ArServerHandlerCommands::myStringCommands [protected]

std::list<ArFunctor3<ArServerClient *, ArNetPacket *, ArFunctor1<ArArgumentBuilder *> *> *> ArServerHandlerCommands::myStringFunctors [protected]


The documentation for this class was generated from the following files:
Generated on Fri Jul 31 12:37:29 2009 for ArNetworking by  doxygen 1.4.7