#include <dynamic-graph/command.h>
Public Member Functions | |
Command (Entity &entity, const std::vector< Value::Type > &valueTypes, const std::string &docstring) | |
Value | execute () |
Execute the command after checking parameters. | |
std::string | getDocstring () const |
Get documentation string. | |
const std::vector< Value > & | getParameterValues () const |
Get parameter values. | |
Entity & | owner () |
Get a reference to the Entity owning this command. | |
void | setParameterValues (const std::vector< Value > &values) |
Set parameter values. | |
const std::vector< Value::Type > & | valueTypes () const |
Return the value type of all parameters. | |
Static Public Attributes | |
static const std::vector< Value::Type > | EMPTY_ARG |
Protected Member Functions | |
virtual Value | doExecute ()=0 |
Specific action performed by the command. | |
Abstract class for entity commands
This class provide a mean to control entities from external python script.
A command
At construction, the prototype of the command is defined by providing a vector of Value::Type.
Parameters are set by calling Command::setParameterValues with a vector of Values the types of which should fit the vector specified at construction.
Command | ( | Entity & | entity, |
const std::vector< Value::Type > & | valueTypes, | ||
const std::string & | docstring | ||
) |
Store the owner entity and a vector of value types
entity | reference to Entity owning this command. |
valueTypes | vector specifying the number and types of parameters |
docstring | documentation of the command |