command.h
Go to the documentation of this file.
1 //
2 // Copyright 2010 CNRS
3 //
4 // Author: Florent Lamiraux
5 //
6 
7 #ifndef DYNAMIC_GRAPH_COMMAND_H
8 #define DYNAMIC_GRAPH_COMMAND_H
9 
10 #include <vector>
11 
13 #include "dynamic-graph/value.h"
14 
15 namespace dynamicgraph {
16 class Entity;
17 namespace command {
35 class DYNAMIC_GRAPH_DLLAPI Command {
36  public:
37  virtual ~Command();
42  Command(Entity &entity, const std::vector<Value::Type> &valueTypes,
43  const std::string &docstring);
45  const std::vector<Value::Type> &valueTypes() const;
47  void setParameterValues(const std::vector<Value> &values);
49  const std::vector<Value> &getParameterValues() const;
51  Value execute();
53  Entity &owner();
55  std::string getDocstring() const;
56 
57  protected:
59  virtual Value doExecute() = 0;
60 
61  private:
63  std::vector<Value::Type> valueTypeVector_;
64  std::vector<Value> valueVector_;
65  std::string docstring_;
66 
67  public:
68  static const std::vector<Value::Type> EMPTY_ARG;
69 };
70 } // namespace command
71 } // namespace dynamicgraph
72 
73 #endif // DYNAMIC_GRAPH_COMMAND_H
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
This class implements a variant design pattern to handle basic types in Command.
Definition: value.h:50
std::vector< Value::Type > valueTypeVector_
Definition: command.h:63
static const std::vector< Value::Type > EMPTY_ARG
Definition: command.h:68
std::vector< Value > valueVector_
Definition: command.h:64


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