Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
dynamicgraph::command::Command Class Referenceabstract

#include <command.h>

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

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...
 
Entityowner ()
 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::TypeEMPTY_ARG = std::vector<Value::Type>()
 

Protected Member Functions

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

Private Attributes

std::string docstring_
 
Entityowner_
 
std::vector< Value::TypevalueTypeVector_
 
std::vector< ValuevalueVector_
 

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 35 of file command.h.

Constructor & Destructor Documentation

◆ ~Command()

dynamicgraph::command::Command::~Command ( )
virtual

Definition at line 18 of file command.cpp.

◆ Command()

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

Definition at line 19 of file command.cpp.

Member Function Documentation

◆ doExecute()

virtual Value dynamicgraph::command::Command::doExecute ( )
protectedpure virtual

◆ execute()

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

Execute the command after checking parameters.

Definition at line 52 of file command.cpp.

◆ getDocstring()

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

Get documentation string.

Definition at line 55 of file command.cpp.

◆ getParameterValues()

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

Get parameter values.

Definition at line 48 of file command.cpp.

◆ owner()

Entity & dynamicgraph::command::Command::owner ( )

Get a reference to the Entity owning this command.

Definition at line 54 of file command.cpp.

◆ setParameterValues()

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

Set parameter values.

Definition at line 27 of file command.cpp.

◆ valueTypes()

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.

Member Data Documentation

◆ docstring_

std::string dynamicgraph::command::Command::docstring_
private

Definition at line 65 of file command.h.

◆ EMPTY_ARG

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

Definition at line 68 of file command.h.

◆ owner_

Entity& dynamicgraph::command::Command::owner_
private

Definition at line 62 of file command.h.

◆ valueTypeVector_

std::vector<Value::Type> dynamicgraph::command::Command::valueTypeVector_
private

Definition at line 63 of file command.h.

◆ valueVector_

std::vector<Value> dynamicgraph::command::Command::valueVector_
private

Definition at line 64 of file command.h.


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


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Sun Jun 25 2023 02:06:03