EEROS  0.4.1.0
API for the EEROS Real-Time Robotics Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TransitionBlock.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_CONTROL_TRANSITIONBLOCK_HPP_
2 #define ORG_EEROS_CONTROL_TRANSITIONBLOCK_HPP_
3 
4 #include <string>
6 
7 namespace eeros {
8  namespace control {
9 
10  template < typename TObject >
11  class TransitionAction : public Runnable {
12  public:
13  using TMethod = void (TObject::*)();
14 
15  TransitionAction(TObject *object, TMethod method) :
16  object(object), method(method) { }
17 
18  virtual void run() { (object->*method)(); }
19  private:
20  TObject *object;
21  TMethod method;
22  };
23 
25  public:
27 
28  virtual void setName(std::string name);
29  virtual std::string getName();
30 
31  virtual Runnable* getRunnableA();
32  virtual Runnable* getRunnableB();
33 
34  virtual void runA() = 0;
35  virtual void runB() = 0;
36 
37  private:
38  std::string name;
41  };
42 
43  };
44 };
45 
46 #endif /* ORG_EEROS_CONTROL_TRANSITIONBLOCK_HPP_ */
virtual void setName(std::string name)
Definition: TransitionBlock.cpp:14
void(TObject::*)( TMethod)
Definition: TransitionBlock.hpp:13
virtual void runB()=0
Definition: TransitionBlock.cpp:21
Definition: Runnable.hpp:6
virtual Runnable * getRunnableB()
Definition: TransitionBlock.cpp:18
Definition: TransitionBlock.hpp:24
virtual Runnable * getRunnableA()
Definition: TransitionBlock.cpp:17
virtual void run()
Definition: TransitionBlock.hpp:18
virtual std::string getName()
Definition: TransitionBlock.cpp:15
virtual void runA()=0
Definition: TransitionBlock.cpp:20
TransitionAction(TObject *object, TMethod method)
Definition: TransitionBlock.hpp:15
Definition: TransitionBlock.hpp:11
TransitionBlock()
Definition: TransitionBlock.cpp:7