Command that calls a parameter getter function. More...
#include <dynamic-graph/command-getter.h>
Public Types | |
typedef T(E::* | GetterMethod )() const |
Pointer to method that sets parameter of type T. | |
Public Member Functions | |
Getter (E &entity, GetterMethod getterMethod, const std::string &docString) | |
Constructor. | |
Protected Member Functions | |
virtual Value | doExecute () |
Specific action performed by the command. |
Command that calls a parameter getter function.
This class is templated by a type E deriving from entity and a type T of data.
Let us assume that class E has a private member of type T and a public getter function for this member:
class E : public Entity { public: E (const std::string& inName) : Entity(inName) {} T getParameter() const {return parameter_;} private: T parameter_; };
Then the command defined by:
E entity("MyEntity");
Getter<E,T> command(entity, &E::getParameter)
returns the value of entity.parameter_
upon invocation.
typedef T(E::* dynamicgraph::command::Getter< E, T >::GetterMethod)() const |
Pointer to method that sets parameter of type T.
dynamicgraph::command::Getter< E, T >::Getter | ( | E & | entity, |
GetterMethod | getterMethod, | ||
const std::string & | docString | ||
) |
Constructor.
Value dynamicgraph::command::Getter< E, T >::doExecute | ( | ) | [protected, virtual] |
Specific action performed by the command.
Implements dynamicgraph::command::Command.