dynamic-graph  4.1.0-8-gdab7-dirty
Dynamic graph library
Command Class Referenceabstract

#include <dynamic-graph/command.h>

Inheritance diagram for Command:

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.
 
Entityowner ()
 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.
 

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.

Definition at line 34 of file command.h.

Constructor & Destructor Documentation

◆ 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

The documentation for this class was generated from the following file: