#include <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. More... | |
std::string | getDocstring () const |
Get documentation string. More... | |
const std::vector< Value > & | getParameterValues () const |
Get parameter values. More... | |
Entity & | owner () |
Get a reference to the Entity owning this command. More... | |
void | setParameterValues (const std::vector< Value > &values) |
Set parameter values. More... | |
const std::vector< Value::Type > & | valueTypes () const |
Return the value type of all parameters. More... | |
virtual | ~Command () |
Static Public Attributes | |
static const std::vector< Value::Type > | EMPTY_ARG = std::vector<Value::Type>() |
Protected Member Functions | |
virtual Value | doExecute ()=0 |
Specific action performed by the command. More... | |
Private Attributes | |
std::string | docstring_ |
Entity & | owner_ |
std::vector< Value::Type > | valueTypeVector_ |
std::vector< Value > | valueVector_ |
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.
|
virtual |
Definition at line 18 of file command.cpp.
dynamicgraph::command::Command::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 |
Definition at line 19 of file command.cpp.
|
protectedpure virtual |
Specific action performed by the command.
Implemented in dynamicgraph::command::CommandReturnType2< E, ReturnType, T1, T2 >, dynamicgraph::command::CommandReturnType1< E, ReturnType, T >, dynamicgraph::command::CommandReturnType0< E, ReturnType >, dynamicgraph::command::CommandVerbose< E >, dynamicgraph::command::CommandVoid8< E, T1, T2, T3, T4, T5, T6, T7, T8 >, dynamicgraph::command::CommandVoid7< E, T1, T2, T3, T4, T5, T6, T7 >, dynamicgraph::command::CommandVoid6< E, T1, T2, T3, T4, T5, T6 >, dynamicgraph::command::CommandVoid5< E, T1, T2, T3, T4, T5 >, dynamicgraph::command::CommandVoid4< E, T1, T2, T3, T4 >, dynamicgraph::command::Setter< E, Matrix >, dynamicgraph::command::Setter< E, Vector >, dynamicgraph::command::CommandVoid3< E, T1, T2, T3 >, dynamicgraph::command::Setter< E, std::string >, dynamicgraph::command::Setter< E, double >, dynamicgraph::command::CommandVoid2< E, T1, T2 >, dynamicgraph::command::Setter< E, float >, dynamicgraph::command::Setter< E, int >, dynamicgraph::command::CommandVoid1< E, T >, dynamicgraph::command::Setter< E, unsigned >, dynamicgraph::command::Getter< E, T >, dynamicgraph::command::Setter< E, T >, dynamicgraph::command::CommandVoid0< E >, dynamicgraph::command::DirectGetter< E, T >, dynamicgraph::command::DirectSetter< E, T >, and dynamicgraph::command::Setter< E, bool >.
Value dynamicgraph::command::Command::execute | ( | ) |
Execute the command after checking parameters.
Definition at line 52 of file command.cpp.
std::string dynamicgraph::command::Command::getDocstring | ( | ) | const |
Get documentation string.
Definition at line 55 of file command.cpp.
const std::vector< Value > & dynamicgraph::command::Command::getParameterValues | ( | ) | const |
Get parameter values.
Definition at line 48 of file command.cpp.
Entity & dynamicgraph::command::Command::owner | ( | ) |
Get a reference to the Entity owning this command.
Definition at line 54 of file command.cpp.
void dynamicgraph::command::Command::setParameterValues | ( | const std::vector< Value > & | values | ) |
Set parameter values.
Definition at line 27 of file command.cpp.
const std::vector< Value::Type > & dynamicgraph::command::Command::valueTypes | ( | ) | const |
Return the value type of all parameters.
Definition at line 23 of file command.cpp.
|
private |
|
static |
|
private |
|
private |