dynamicgraph::command::Command Class Referenceabstract

Abstract class for entity commands. More...

#include <dynamic-graph/command.h>

Inheritance diagram for dynamicgraph::command::Command:
[legend]
Collaboration diagram for dynamicgraph::command::Command:
[legend]

Public Member Functions

virtual ~Command ()
 
 Command (Entity &entity, const std::vector< Value::Type > &valueTypes, const std::string &docstring)
 Store the owner entity and a vector of value types. More...
 
const std::vector< Value::Type > & valueTypes () const
 Return the value type of all parameters. More...
 
void setParameterValues (const std::vector< Value > &values)
 Set parameter values. More...
 
const std::vector< Value > & getParameterValues () const
 Get parameter values. More...
 
Value execute ()
 Execute the command after checking parameters. More...
 
Entityowner ()
 Get a reference to the Entity owning this command. More...
 
std::string getDocstring () const
 Get documentation string. More...
 

Static Public Attributes

static const std::vector< Value::TypeEMPTY_ARG
 

Protected Member Functions

virtual Value doExecute ()=0
 Specific action performed by the command. More...
 

Detailed Description

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.

Constructor & Destructor Documentation

virtual dynamicgraph::command::Command::~Command ( )
virtual
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.

Parameters
entityreference to Entity owning this command.
valueTypesvector specifying the number and types of parameters
docstringdocumentation of the command

Member Function Documentation

Value dynamicgraph::command::Command::execute ( )

Execute the command after checking parameters.

std::string dynamicgraph::command::Command::getDocstring ( ) const

Get documentation string.

void dynamicgraph::command::Command::setParameterValues ( const std::vector< Value > &  values)

Set parameter values.

const std::vector<Value::Type>& dynamicgraph::command::Command::valueTypes ( ) const

Return the value type of all parameters.

Member Data Documentation

const std::vector<Value::Type> dynamicgraph::command::Command::EMPTY_ARG
static