A command repository stores a number of commands from a Task which can be used by other tasks or from scripts. More...
#include <rtt/CommandRepository.hpp>
Public Types | |
typedef CommandFactory | Factory |
typedef std::vector < ArgumentDescription > | Descriptions |
The descriptions of an argumentlist. | |
typedef std::vector < DataSourceBase::shared_ptr > | Arguments |
The arguments for an operation. | |
Public Member Functions | |
template<class Signature > | |
DispatchInterface * | getCommand (std::string name) |
Return the pointer to an added command for use in a Command object. | |
void | clear () |
Clears the complete interface and frees all memory. | |
std::vector< std::string > | getCommands () const |
Returns the names of all commands added to this interface. | |
bool | hasCommand (const std::string &name) const |
Query for the existence of a Command in this interface. | |
void | removeCommand (const std::string &name) |
Removes a previously added command. | |
template<class CommandT > | |
bool | addCommand (CommandT *com) |
Add a Command object to the command interface. | |
template<class CommandT > | |
bool | addCommand (CommandT com, const char *description) |
Add a Command object, which takes no arguments, to the command interface. | |
template<class CommandT > | |
bool | addCommand (CommandT com, const char *description, const char *arg1, const char *arg1_description) |
Add a Command object, which takes one argument, to the command interface. | |
template<class CommandT > | |
bool | addCommand (CommandT com, const char *description, const char *arg1, const char *arg1_description, const char *arg2, const char *arg2_description) |
Add a Command object, which takes two arguments, to the command interface. | |
template<class CommandT > | |
bool | addCommand (CommandT com, const char *description, const char *arg1, const char *arg1_description, const char *arg2, const char *arg2_description, const char *arg3, const char *arg3_description) |
Add a Command object, which takes three arguments, to the command interface. | |
template<class CommandT > | |
bool | addCommand (CommandT com, const char *description, const char *arg1, const char *arg1_description, const char *arg2, const char *arg2_description, const char *arg3, const char *arg3_description, const char *arg4, const char *arg4_description) |
Add a Command object, which takes four arguments, to the command interface. | |
DispatchInterface * | getCommand (std::string name, const std::vector< DataSourceBase::shared_ptr > &args) const |
For internal use only. | |
template<class CommandT , class CompT > | |
bool | addCommandDS (DataSource< boost::weak_ptr< CompT > > *wp, CommandT c, const char *description) |
For internal use only. | |
template<class CommandT , class CompT > | |
bool | addCommandDS (DataSource< boost::weak_ptr< CompT > > *wp, CommandT c, const char *description, const char *arg1, const char *arg1_description) |
For internal use only. | |
ConditionInterface * | getCondition (std::string name, const std::vector< DataSourceBase::shared_ptr > &args) const |
For internal use Only. | |
CommandC | create (std::string name) |
Create a CommandC container object, which can be used to access an added Command. | |
std::vector< std::string > | getNames () const |
Get a list of all the names of the added operations. | |
bool | hasMember (const std::string &name) const |
Query if an operation is present. | |
int | getArity (const std::string &name) const |
Query the number of arguments of an operation. | |
DispatchInterface * | produce (const std::string &name, const PropertyBag &args) const |
Produce an object that contains an operation. | |
DispatchInterface * | produce (const std::string &name, const std::vector< DataSourceBase::shared_ptr > &args) const |
Produce an object that contains an operation. | |
Descriptions | getArgumentList (const std::string &name) const |
Get the names and descriptions of all arguments of an operation. | |
std::string | getResultType (const std::string &name) const |
Get the type name of the result type of an operation. | |
std::string | getDescription (const std::string &name) const |
Get the description of an operation. | |
void | add (const std::string &name, detail::OperationFactoryPart< DispatchInterface * > *part) |
Add a new operation to the interface. | |
void | remove (const std::string &name) |
Remove an added operation from the interface. | |
Protected Types | |
typedef std::map< std::string, detail::OperationFactoryPart < DispatchInterface * > * > | map_t |
Protected Attributes | |
map_t | data |
A command repository stores a number of commands from a Task which can be used by other tasks or from scripts.
Definition at line 60 of file CommandRepository.hpp.
void RTT::OperationFactory< DispatchInterface * >::add | ( | const std::string & | name, | |
detail::OperationFactoryPart< DispatchInterface * > * | part | |||
) | [inline, inherited] |
Add a new operation to the interface.
name | The name of the operation | |
part | A part which creates the operation. |
Definition at line 557 of file OperationFactory.hpp.
bool RTT::CommandRepository::addCommand | ( | CommandT | com, | |
const char * | description, | |||
const char * | arg1, | |||
const char * | arg1_description, | |||
const char * | arg2, | |||
const char * | arg2_description, | |||
const char * | arg3, | |||
const char * | arg3_description, | |||
const char * | arg4, | |||
const char * | arg4_description | |||
) | [inline] |
Add a Command object, which takes four arguments, to the command interface.
The command is added to the C++ and to the scripting interface.
c | A pointer to the Command object. | |
description | A user readable description of what this command does. | |
arg1 | A single word name of the first argument. | |
arg1_description | A user readable description of the first argument. | |
arg2 | A single word name of the second argument. | |
arg2_description | A user readable description of the second argument. | |
arg3 | A single word name of the third argument. | |
arg3_description | A user readable description of the third argument. | |
arg4 | A single word name of the fourth argument. | |
arg4_description | A user readable description of the fourth argument. |
Definition at line 340 of file CommandRepository.hpp.
bool RTT::CommandRepository::addCommand | ( | CommandT | com, | |
const char * | description, | |||
const char * | arg1, | |||
const char * | arg1_description, | |||
const char * | arg2, | |||
const char * | arg2_description, | |||
const char * | arg3, | |||
const char * | arg3_description | |||
) | [inline] |
Add a Command object, which takes three arguments, to the command interface.
The command is added to the C++ and to the scripting interface.
c | A pointer to the Command object. | |
description | A user readable description of what this command does. | |
arg1 | A single word name of the first argument. | |
arg1_description | A user readable description of the first argument. | |
arg2 | A single word name of the second argument. | |
arg2_description | A user readable description of the second argument. | |
arg3 | A single word name of the third argument. | |
arg3_description | A user readable description of the third argument. |
Definition at line 292 of file CommandRepository.hpp.
bool RTT::CommandRepository::addCommand | ( | CommandT | com, | |
const char * | description, | |||
const char * | arg1, | |||
const char * | arg1_description, | |||
const char * | arg2, | |||
const char * | arg2_description | |||
) | [inline] |
Add a Command object, which takes two arguments, to the command interface.
The command is added to the C++ and to the scripting interface.
c | A pointer to the Command object. | |
description | A user readable description of what this command does. | |
arg1 | A single word name of the first argument. | |
arg1_description | A user readable description of the first argument. | |
arg2 | A single word name of the second argument. | |
arg2_description | A user readable description of the second argument. |
Definition at line 247 of file CommandRepository.hpp.
bool RTT::CommandRepository::addCommand | ( | CommandT | com, | |
const char * | description, | |||
const char * | arg1, | |||
const char * | arg1_description | |||
) | [inline] |
Add a Command object, which takes one argument, to the command interface.
The command is added to the C++ and to the scripting interface.
c | A pointer to the existing command. | |
description | A user readable description of what this command does. | |
arg1 | A single word name of the argument. | |
arg1_description | A user readable description of the argument. |
Definition at line 207 of file CommandRepository.hpp.
bool RTT::CommandRepository::addCommand | ( | CommandT | com, | |
const char * | description | |||
) | [inline] |
Add a Command object, which takes no arguments, to the command interface.
The command is added to the C++ and to the scripting interface.
c | A pointer to the existing command. | |
description | A user readable description of what this command does. |
Definition at line 168 of file CommandRepository.hpp.
bool RTT::CommandRepository::addCommand | ( | CommandT * | com | ) | [inline] |
Add a Command object to the command interface.
The command is added to the C++ interface and not added to the scripting interface.
com | A pointer to a Command object. |
Definition at line 142 of file CommandRepository.hpp.
bool RTT::CommandRepository::addCommandDS | ( | DataSource< boost::weak_ptr< CompT > > * | wp, | |
CommandT | c, | |||
const char * | description, | |||
const char * | arg1, | |||
const char * | arg1_description | |||
) | [inline] |
For internal use only.
The pointer of the object of which a member function must be invoked is stored in a DataSource such that the pointer can change during program execution. Required in scripting for state machines.
Definition at line 414 of file CommandRepository.hpp.
bool RTT::CommandRepository::addCommandDS | ( | DataSource< boost::weak_ptr< CompT > > * | wp, | |
CommandT | c, | |||
const char * | description | |||
) | [inline] |
For internal use only.
The pointer of the object of which a member function must be invoked is stored in a DataSource such that the pointer can change during program execution. Required in scripting for state machines.
Definition at line 391 of file CommandRepository.hpp.
CommandC RTT::CommandRepository::create | ( | std::string | name | ) | [inline] |
Descriptions RTT::OperationFactory< DispatchInterface * >::getArgumentList | ( | const std::string & | name | ) | const [inline, inherited] |
Get the names and descriptions of all arguments of an operation.
name | The name of the operation |
Definition at line 516 of file OperationFactory.hpp.
int RTT::OperationFactory< DispatchInterface * >::getArity | ( | const std::string & | name | ) | const [inline, inherited] |
Query the number of arguments of an operation.
name | The name of the operation |
Definition at line 468 of file OperationFactory.hpp.
DispatchInterface* RTT::CommandRepository::getCommand | ( | std::string | name, | |
const std::vector< DataSourceBase::shared_ptr > & | args | |||
) | const [inline] |
For internal use only.
Retrieve a previously added Command.
name | The name of the Command | |
args | A vector of command arguments. |
Definition at line 379 of file CommandRepository.hpp.
DispatchInterface* RTT::CommandRepository::getCommand | ( | std::string | name | ) | [inline] |
Return the pointer to an added command for use in a Command object.
Store the result in a Command<Signature> object.
name | The name of the command to retrieve. | |
Signature | The function signature of the command, for example: getCommand<bool(int,double)>("name"); |
Definition at line 90 of file CommandRepository.hpp.
std::vector<std::string> RTT::CommandRepository::getCommands | ( | ) | const |
Returns the names of all commands added to this interface.
ConditionInterface* RTT::CommandRepository::getCondition | ( | std::string | name, | |
const std::vector< DataSourceBase::shared_ptr > & | args | |||
) | const [inline] |
For internal use Only.
Retrieve the completion condition of a previously added Command.
name | The name of the Command | |
args | A vector of command arguments |
Definition at line 440 of file CommandRepository.hpp.
std::string RTT::OperationFactory< DispatchInterface * >::getDescription | ( | const std::string & | name | ) | const [inline, inherited] |
Get the description of an operation.
name | The name of the operation |
Definition at line 544 of file OperationFactory.hpp.
std::string RTT::OperationFactory< DispatchInterface * >::getResultType | ( | const std::string & | name | ) | const [inline, inherited] |
Get the type name of the result type of an operation.
name | The name of the operation |
Definition at line 530 of file OperationFactory.hpp.
bool RTT::CommandRepository::hasCommand | ( | const std::string & | name | ) | const |
Query for the existence of a Command in this interface.
DispatchInterface * RTT::OperationFactory< DispatchInterface * >::produce | ( | const std::string & | name, | |
const std::vector< DataSourceBase::shared_ptr > & | args | |||
) | const [inline, inherited] |
Produce an object that contains an operation.
name | The name of the operation | |
args | The arguments filled in as data sources. |
Definition at line 501 of file OperationFactory.hpp.
DispatchInterface * RTT::OperationFactory< DispatchInterface * >::produce | ( | const std::string & | name, | |
const PropertyBag & | args | |||
) | const [inline, inherited] |
Produce an object that contains an operation.
name | The name of the operation | |
args | The arguments filled in as properties. |
Definition at line 482 of file OperationFactory.hpp.
void RTT::OperationFactory< DispatchInterface * >::remove | ( | const std::string & | name | ) | [inline, inherited] |
Remove an added operation from the interface.
name | The name of the operation |
Definition at line 572 of file OperationFactory.hpp.