| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

PRGraphVisitors.h
Go to the documentation of this file.
1 #ifndef PRGRAPHVISITORS_H_
2 #define PRGRAPHVISITORS_H_
3
4 #include "EventSlot.h"
5 #include "IGraphVisitor.h"
6 #include "PrecedenceRulesGraph.h"
7
8 namespace concurrency
9 {
10
11 class DataReadyPromoter : public IGraphVisitor
12 {
13 public:
15 DataReadyPromoter( EventSlot& slot, const Cause& cause, bool ifTrace = false )
16 : m_slot( &slot ), m_cause( cause ), m_trace( ifTrace ){};
17
18 using IGraphVisitor::visit;
19 using IGraphVisitor::visitEnter;
20
21 bool visitEnter( AlgorithmNode& ) const override;
22
23 bool visit( AlgorithmNode& ) override;
24
25 bool visitEnter( DataNode& ) const override;
26
27 bool visit( DataNode& ) override;
28
29 bool visitEnter( ConditionNode& ) const override;
30
31 bool visit( ConditionNode& ) override;
32
33 EventSlot* m_slot;
34 Cause m_cause;
35 bool m_trace;
36 };
37
38 class DecisionUpdater : public IGraphVisitor
39 {
40 public:
42 DecisionUpdater( EventSlot& slot, const Cause& cause, bool ifTrace = false )
43 : m_slot( &slot ), m_cause( cause ), m_trace( ifTrace ){};
44
45 using IGraphVisitor::visit;
46
47 bool visit( AlgorithmNode& ) override;
48
49 EventSlot* m_slot;
50 Cause m_cause;
51 bool m_trace;
52 };
53
54 class Supervisor : public IGraphVisitor
55 {
56 public:
58 Supervisor( EventSlot& slot, const Cause& cause, bool ifTrace = false )
59 : m_slot( &slot ), m_cause( cause ), m_trace( ifTrace ){};
60
61 using IGraphVisitor::visit;
62 using IGraphVisitor::visitEnter;
63
64 bool visitEnter( DecisionNode& ) const override;
65
66 bool visit( DecisionNode& ) override;
67
68 bool visitEnter( AlgorithmNode& ) const override;
69
70 bool visit( AlgorithmNode& ) override;
71
72 EventSlot* m_slot;
73 Cause m_cause;
74 bool m_trace;
75 };
76
77 class RankerByProductConsumption : public IGraphVisitor
78 {
79 public:
80 using IGraphVisitor::visit;
81
82 bool visit( AlgorithmNode& ) override;
83 };
84
85 class RankerByCummulativeOutDegree : public IGraphVisitor
86 {
87 public:
88 using IGraphVisitor::visit;
89
90 bool visit( AlgorithmNode& ) override;
91 void reset() override { m_nodesSucceeded = 0; };
92
93 void runThroughAdjacents( boost::graph_traits<precedence::PrecTrace>::vertex_descriptor, precedence::PrecTrace );
94
95 int m_nodesSucceeded{0};
96 };
97
98 class RankerByTiming : public IGraphVisitor
99 {
100 public:
101 using IGraphVisitor::visit;
102
103 bool visit( AlgorithmNode& ) override;
104 };
105
106 class RankerByEccentricity : public IGraphVisitor
107 {
108 public:
109 using IGraphVisitor::visit;
110
111 bool visit( AlgorithmNode& ) override;
112 };
113
114 class RankerByDataRealmEccentricity : public IGraphVisitor
115 {
116 public:
117 using IGraphVisitor::visit;
118
119 bool visit( AlgorithmNode& ) override;
120
121 void reset() override
122 {
123 m_currentDepth = 0;
124 m_maxKnownDepth = 0;
125 }
126
129 void recursiveVisit( AlgorithmNode& );
130
131 uint m_currentDepth{0};
132 uint m_maxKnownDepth{0};
133 };
134
135 class RunSimulator : public IGraphVisitor
136 {
137 public:
139 RunSimulator( EventSlot& slot, const Cause& cause ) : m_slot( &slot ), m_cause( cause ){};
140
141 using IGraphVisitor::visit;
142 using IGraphVisitor::visitEnter;
143
144 bool visitEnter( DecisionNode& ) const override;
145
146 bool visit( DecisionNode& ) override;
147
148 bool visitEnter( AlgorithmNode& ) const override;
149
150 bool visit( AlgorithmNode& ) override;
151
152 void reset() override { m_nodesSucceeded = 0; };
153
154 EventSlot* m_slot;
155 Cause m_cause;
156 int m_nodesSucceeded{0};
157 };
158 }
159
160 #endif /* PRGRAPHVISITORS_H_ */
concurrency::Supervisor::m_slot
EventSlot * m_slot
Definition: PRGraphVisitors.h:72
concurrency::DecisionNode
Definition: PrecedenceRulesGraph.h:478
concurrency::DataReadyPromoter::visit
bool visit(AlgorithmNode &) override
Definition: PRGraphVisitors.cpp:22
concurrency::RunSimulator::reset
void reset() override
Definition: PRGraphVisitors.h:152
concurrency::DataNode
Definition: PrecedenceRulesGraph.h:616
concurrency::RunSimulator
Definition: PRGraphVisitors.h:135
concurrency
Definition: IGraphVisitor.h:4
concurrency::Supervisor::m_trace
bool m_trace
Definition: PRGraphVisitors.h:74
concurrency::IGraphVisitor::visit
virtual bool visit(DecisionNode &)
Definition: IGraphVisitor.h:18
concurrency::RankerByDataRealmEccentricity::reset
void reset() override
Definition: PRGraphVisitors.h:121
concurrency::DataReadyPromoter::m_slot
EventSlot * m_slot
Definition: PRGraphVisitors.h:33
concurrency::DecisionUpdater::m_slot
EventSlot * m_slot
Definition: PRGraphVisitors.h:49
concurrency::RankerByCummulativeOutDegree::reset
void reset() override
Definition: PRGraphVisitors.h:91
concurrency::DataReadyPromoter::visitEnter
bool visitEnter(AlgorithmNode &) const override
Definition: PRGraphVisitors.cpp:13
concurrency::IGraphVisitor::visitEnter
virtual bool visitEnter(DecisionNode &) const
Definition: IGraphVisitor.h:17
concurrency::RunSimulator::RunSimulator
RunSimulator(EventSlot &slot, const Cause &cause)
Constructor.
Definition: PRGraphVisitors.h:139
concurrency::RankerByTiming
Definition: PRGraphVisitors.h:98
concurrency::RankerByDataRealmEccentricity
Definition: PRGraphVisitors.h:114
concurrency::RunSimulator::m_cause
Cause m_cause
Definition: PRGraphVisitors.h:155
Cause
Definition: PrecedenceRulesGraph.h:426
concurrency::DataReadyPromoter::DataReadyPromoter
DataReadyPromoter(EventSlot &slot, const Cause &cause, bool ifTrace=false)
Constructor.
Definition: PRGraphVisitors.h:15
concurrency::RankerByEccentricity
Definition: PRGraphVisitors.h:106
precedence::PrecTrace
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoTraceProps > PrecTrace
Definition: PrecedenceRulesGraph.h:55
concurrency::DecisionUpdater
Definition: PRGraphVisitors.h:38
concurrency::DecisionUpdater::m_trace
bool m_trace
Definition: PRGraphVisitors.h:51
concurrency::IGraphVisitor
Definition: IGraphVisitor.h:12
concurrency::DataReadyPromoter::m_trace
bool m_trace
Definition: PRGraphVisitors.h:35
concurrency::DataReadyPromoter::m_cause
Cause m_cause
Definition: PRGraphVisitors.h:34
concurrency::DecisionUpdater::m_cause
Cause m_cause
Definition: PRGraphVisitors.h:50
concurrency::RankerByProductConsumption
Definition: PRGraphVisitors.h:77
concurrency::ConditionNode
Definition: PrecedenceRulesGraph.h:659
EventSlot
Class representing the event slot.
Definition: EventSlot.h:10
concurrency::AlgorithmNode
Definition: PrecedenceRulesGraph.h:531
IGraphVisitor.h
concurrency::DataReadyPromoter
Definition: PRGraphVisitors.h:11
concurrency::Supervisor
Definition: PRGraphVisitors.h:54
concurrency::Supervisor::m_cause
Cause m_cause
Definition: PRGraphVisitors.h:73
concurrency::DecisionUpdater::DecisionUpdater
DecisionUpdater(EventSlot &slot, const Cause &cause, bool ifTrace=false)
Constructor.
Definition: PRGraphVisitors.h:42
PrecedenceRulesGraph.h
EventSlot.h
concurrency::RankerByCummulativeOutDegree
Definition: PRGraphVisitors.h:85
concurrency::Supervisor::Supervisor
Supervisor(EventSlot &slot, const Cause &cause, bool ifTrace=false)
Constructor.
Definition: PRGraphVisitors.h:58