dynamicgraph::command::Command Class Reference

Abstract class for entity commands. More...

#include <dynamic-graph/command.h>

Inheritance diagram for dynamicgraph::command::Command:
Collaboration diagram for dynamicgraph::command::Command:

List of all members.

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.
const std::vector< Value::Type > & valueTypes () const
 Return the value type of all parameters.
void setParameterValues (const std::vector< Value > &values)
 Set parameter values.
const std::vector< Value > & getParameterValues () const
 Get parameter values.
Value execute ()
 Execute the command after checking parameters.
Entityowner ()
 Get a reference to the Entity owning this command.
std::string getDocstring () const
 Get documentation string.

Static Public Attributes

static const std::vector
< Value::Type
EMPTY_ARG

Protected Member Functions

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

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