command-getter.t.cpp
Go to the documentation of this file.
1 //
2 // Copyright 2010 CNRS
3 //
4 // Author: Florent Lamiraux
5 //
6 
7 #ifndef DYNAMIC_GRAPH_COMMAND_GETTER_T_CPP
8 #define DYNAMIC_GRAPH_COMMAND_GETTER_T_CPP
9 
11 
12 #include <sstream>
13 
14 namespace dynamicgraph {
15 class Entity;
16 namespace command {
17 
18 template <class E, typename T>
19 Getter<E, T>::Getter(E &entity, GetterMethod getterMethod,
20  const std::string &docstring)
21  : Command(entity, std::vector<Value::Type>(), docstring),
22  getterMethod_(getterMethod) {}
23 
24 template <class E, typename T>
26  E &entity = static_cast<E &>(owner());
27  T value = (entity.*getterMethod_)();
28  return Value(value);
29 }
30 } // namespace command
31 } // namespace dynamicgraph
32 
33 #endif // DYNAMIC_GRAPH_COMMAND_GETTER_T_CPP
command-getter.h
dynamicgraph
dynamicgraph::command::Command
Definition: command.h:35
dynamicgraph::command::Getter::doExecute
virtual Value doExecute()
Specific action performed by the command.
Definition: command-getter.t.cpp:25
dynamicgraph::command::Value
This class implements a variant design pattern to handle basic types in Command.
Definition: value.h:51
dynamicgraph::command::Getter::Getter
Getter(E &entity, GetterMethod getterMethod, const std::string &docString)
Constructor.
Definition: command-getter.t.cpp:19


dynamic-graph
Author(s): Nicolas Mansard, Olivier Stasse
autogenerated on Fri Aug 2 2024 08:36:38