The Gaudi Framework  v32r2 (46d42edc)
Promoters.h
Go to the documentation of this file.
1 #ifndef PROMOTERS_H_
2 #define PROMOTERS_H_
3 
4 #include "../../EventSlot.h"
5 #include "../PrecedenceRulesGraph.h"
6 #include "IGraphVisitor.h"
7 
8 namespace concurrency {
9 
10  //--------------------------------------------------------------------------
12  public:
14  DataReadyPromoter( EventSlot& slot, const Cause& cause, bool ifTrace = false )
15  : m_slot( &slot ), m_cause( cause ), m_trace( ifTrace ){};
16 
19 
20  bool visitEnter( AlgorithmNode& ) const override;
21 
22  bool visit( AlgorithmNode& ) override;
23 
24  bool visitEnter( DataNode& ) const override;
25 
26  bool visit( DataNode& ) override;
27 
28  bool visitEnter( ConditionNode& ) const override;
29 
30  bool visit( ConditionNode& ) override;
31 
34  bool m_trace;
35  };
36 
37  //--------------------------------------------------------------------------
38  class DecisionUpdater : public IGraphVisitor {
39  public:
41  DecisionUpdater( EventSlot& slot, const Cause& cause, bool ifTrace = false )
42  : m_slot( &slot ), m_cause( cause ), m_trace( ifTrace ){};
43 
45 
46  bool visit( AlgorithmNode& ) override;
47 
50  bool m_trace;
51  };
52 
53  //--------------------------------------------------------------------------
54  class Supervisor : public IGraphVisitor {
55  public:
57  Supervisor( EventSlot& slot, const Cause& cause, bool ifTrace = false )
58  : m_slot( &slot ), m_cause( cause ), m_trace( ifTrace ){};
59 
62 
63  bool visitEnter( DecisionNode& ) const override;
64 
65  bool visit( DecisionNode& ) override;
66 
67  bool visitEnter( AlgorithmNode& ) const override;
68 
69  bool visit( AlgorithmNode& ) override;
70 
73  bool m_trace;
74  };
75 
76  //--------------------------------------------------------------------------
77  class RunSimulator : public IGraphVisitor {
78  public:
80  RunSimulator( EventSlot& slot, const Cause& cause ) : m_slot( &slot ), m_cause( cause ){};
81 
84 
85  bool visitEnter( DecisionNode& ) const override;
86 
87  bool visit( DecisionNode& ) override;
88 
89  bool visitEnter( AlgorithmNode& ) const override;
90 
91  bool visit( AlgorithmNode& ) override;
92 
93  void reset() override { m_nodesSucceeded = 0; };
94 
98  };
99 } // namespace concurrency
100 
101 #endif /* PROMOTERS_H_ */
EventSlot * m_slot
Definition: Promoters.h:71
Class representing an event slot.
Definition: EventSlot.h:14
bool visit(AlgorithmNode &) override
Definition: Promoters.cpp:22
void reset() override
Definition: Promoters.h:93
virtual bool visit(DecisionNode &)
Definition: IGraphVisitor.h:16
virtual bool visitEnter(DecisionNode &) const
Definition: IGraphVisitor.h:15
bool visit(DecisionNode &) override
Definition: Promoters.cpp:356
bool visitEnter(AlgorithmNode &) const override
Definition: Promoters.cpp:14
bool visit(AlgorithmNode &) override
Definition: Promoters.cpp:104
RunSimulator(EventSlot &slot, const Cause &cause)
Constructor.
Definition: Promoters.h:80
DataReadyPromoter(EventSlot &slot, const Cause &cause, bool ifTrace=false)
Constructor.
Definition: Promoters.h:14
bool visitEnter(DecisionNode &) const override
Definition: Promoters.cpp:153
bool visit(DecisionNode &) override
Definition: Promoters.cpp:160
bool visitEnter(DecisionNode &) const override
Definition: Promoters.cpp:349
DecisionUpdater(EventSlot &slot, const Cause &cause, bool ifTrace=false)
Constructor.
Definition: Promoters.h:41
Supervisor(EventSlot &slot, const Cause &cause, bool ifTrace=false)
Constructor.
Definition: Promoters.h:57