dynamic-graph  4.4.3
Dynamic graph library
command.h
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 
12 #include "dynamic-graph/dynamic-graph-api.h"
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:
62  Entity &owner_;
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
dynamicgraph
Definition: command-bind.h:30
dynamicgraph::Entity
This class represents an entity, i.e. a generic computational unit that provides input and output sig...
Definition: entity.h:52
dynamicgraph::command::Command
Definition: command.h:35
dynamicgraph::command::Value
This class implements a variant design pattern to handle basic types in Command.
Definition: value.h:50