senf::console::CommandOverload Class Reference

Base class for command overload of OverloadedCommandNode. More...

#include <senf/Utils/Console/OverloadedCommand.hh>

Inheritance diagram for senf::console::CommandOverload:
Inheritance graph
[legend]

List of all members.


Detailed Description

Base class for command overload of OverloadedCommandNode.

This class is the base class of the commands which may be added to an OverloadedCommandNode.

Definition at line 61 of file OverloadedCommand.hh.


Public Types

typedef boost::intrusive_ptr
< CommandOverload
ptr
typedef boost::intrusive_ptr
< CommandOverload const > 
cptr

Public Member Functions

virtual  ~CommandOverload ()
void  execute (boost::any &rv, std::ostream &os, ParseCommandInfo const &command)
  Call the overload.
void  operator() (boost::any &rv, std::ostream &os, ParseCommandInfo const &command)
  Call the overload.
unsigned  numArguments () const
  Number of arguments this overload takes.
void  argumentDoc (unsigned index, ArgumentDoc &doc) const
  Get information on argument index.
std::string  doc () const
  Get overload documentation.
OverloadedCommandNode node () const
  Access owning node.
unsigned  overloadIndex () const
  Get index of overload in it's OverloadedCommandNode.

Protected Member Functions

  CommandOverload ()
virtual unsigned  v_numArguments () const =0
  Return the number of arguments.
virtual void  v_argumentDoc (unsigned index, ArgumentDoc &doc) const =0
  Return argument documentation.
virtual std::string  v_doc () const =0
  Return overload documentation.
virtual void  v_execute (boost::any &rv, std::ostream &os, ParseCommandInfo const &command) const =0
  Execute the overload.

Member Typedef Documentation

typedef boost::intrusive_ptr<CommandOverload const> senf::console::CommandOverload::
cptr

Definition at line 69 of file OverloadedCommand.hh.

typedef boost::intrusive_ptr<CommandOverload> senf::console::CommandOverload::
ptr

Constructor & Destructor Documentation

senf::console::CommandOverload::
~CommandOverload ()

Definition at line 86 of file OverloadedCommand.cci.

senf::console::CommandOverload::
CommandOverload ()

Definition at line 132 of file OverloadedCommand.cci.


Member Function Documentation

void senf::console::CommandOverload::
argumentDoc ( unsigned  index,
ArgumentDoc doc )

Get information on argument index.

The information is returned in doc. doc must be empty before this call.

Precondition:
index < numArguments()
Parameters:
[in]  index  Argument index
[out]  doc  Argument documentation

Definition at line 107 of file OverloadedCommand.cci.

std::string senf::console::CommandOverload::
doc ()

Get overload documentation.

Definition at line 113 of file OverloadedCommand.cci.

void senf::console::CommandOverload::
execute ( boost::any &  rv,
std::ostream &  os,
ParseCommandInfo const &  command )

Call the overload.

If the arguments are not acceptable for this overload, a SyntaxErrorException must be thrown. Same as operator()()

Definition at line 89 of file OverloadedCommand.cci.

senf::console::OverloadedCommandNode & senf::console::CommandOverload::
node ()

Access owning node.

Precondition:
The command must have been added to an OverloadedCommandNode.

Definition at line 119 of file OverloadedCommand.cci.

unsigned senf::console::CommandOverload::
numArguments ()

Number of arguments this overload takes.

Definition at line 101 of file OverloadedCommand.cci.

void senf::console::CommandOverload::
operator() ( boost::any &  rv,
std::ostream &  os,
ParseCommandInfo const &  command )

Call the overload.

If the arguments are not acceptable for this overload, a SyntaxErrorException must be thrown. Same as execute()

Definition at line 95 of file OverloadedCommand.cci.

unsigned senf::console::CommandOverload::
overloadIndex ()

Get index of overload in it's OverloadedCommandNode.

Definition at line 126 of file OverloadedCommand.cci.

virtual void senf::console::CommandOverload::
v_argumentDoc ( unsigned  index,
ArgumentDoc doc )

Return argument documentation.

The member must be implemented int the derived class to return all documentation information for the index'th parameter in doc.

virtual std::string senf::console::CommandOverload::
v_doc ()

Return overload documentation.

This member must be implemented in the derived class to return the overloads documentation string.

virtual void senf::console::CommandOverload::
v_execute ( boost::any &  rv,
std::ostream &  os,
ParseCommandInfo const &  command )

Execute the overload.

This member must be implemented in the derived class o execute the overload.

virtual unsigned senf::console::CommandOverload::
v_numArguments ()

Return the number of arguments.

This member must be implemented in the derived class to return the number of arguments, the command expects.


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