EEROS  1.0.0.0
API for the EEROS Real-Time Robotics Framework
Monitor.hpp
Go to the documentation of this file.
1 #ifndef ORG_EEROS_SEQUENCER_MONITOR_HPP_
2 #define ORG_EEROS_SEQUENCER_MONITOR_HPP_
3 
4 #include <string>
5 
6 namespace eeros {
7  namespace sequencer {
8 
9  class BaseSequence;
10  class Condition;
11 
12  enum class SequenceProp {
13  resume, // continue (only exception sequence is called, if available)
14  abort, // abort the owner sequence or step of this monitor
15  restart // restart the owner sequence or step of this monitor
16  };
17 
18  class Monitor {
19  friend class BaseSequence;
20  public:
21  Monitor(std::string name, BaseSequence* owner, Condition& condition, SequenceProp behavior = SequenceProp::resume, BaseSequence* exceptionSequence = nullptr);
22  virtual ~Monitor();
23  void setExceptionSequence(BaseSequence& exceptionSequence);
24  void setBehavior(SequenceProp behavior);
25  SequenceProp getBehavior() const;
26  BaseSequence* getOwner() const;
27  protected:
28  bool checkCondition();
29  void startExceptionSequence();
34  std::string name;
35  };
36 
37  /********** Print functions **********/
38  std::ostream& operator<<(std::ostream& os, SequenceProp prop);
39 
40 
41  }; //namespace sequencer
42 }; // namespace eeros
43 
44 #endif // ORG_EEROS_SEQUENCER_MONITOR_HPP_
BaseSequence * exceptionSequence
Definition: Monitor.hpp:31
std::string name
Definition: Monitor.hpp:34
Definition: Condition.hpp:7
SequenceProp
Definition: Monitor.hpp:12
BaseSequence * owner
Definition: Monitor.hpp:30
Definition: Monitor.hpp:18
Definition: Config.hpp:14
std::ostream & operator<<(std::ostream &os, SequenceState state)
Definition: BaseSequence.cpp:210
Definition: BaseSequence.hpp:27
SequenceProp behavior
Definition: Monitor.hpp:33
Condition & condition
Definition: Monitor.hpp:32