EFGraphVisitors.h
Go to the documentation of this file.
1 #ifndef EFGRAPHVISITORS_H_
2 #define EFGRAPHVISITORS_H_
3 
4 #include "IGraphVisitor.h"
5 #include "ExecutionFlowGraph.h"
6 
7 namespace concurrency {
8 
9  class RunSimulator : public IGraphVisitor {
10  public:
12  RunSimulator(const int& slotNum) {
13  m_nodesSucceeded = 0;
14  m_slotNum = slotNum;
15  };
17  ~RunSimulator() override {}
18 
19  bool visitEnter(DecisionNode& node) const override;
20 
21  bool visit(DecisionNode& node) override;
22 
23  bool visitLeave(DecisionNode& node) const override;
24 
25 
26  bool visitEnter(AlgorithmNode& node) const override;
27 
28  bool visit(AlgorithmNode& node) override;
29 
30 
31  void reset() override { m_nodesSucceeded = 0; }
32 
33  };
34 
38  class Trigger : public IGraphVisitor {
39  public:
41  Trigger(const int& slotNum) {
42  m_nodesSucceeded = 0;
43  m_slotNum = slotNum;
44  };
46  ~Trigger() override {}
47 
48  bool visitEnter(DecisionNode& node) const override;
49 
50  bool visit(DecisionNode& node) override;
51 
52  bool visitLeave(DecisionNode& node) const override;
53 
54 
55  bool visitEnter(AlgorithmNode& node) const override;
56 
57  bool visit(AlgorithmNode& node) override;
58 
59 
60  void reset() override { m_nodesSucceeded = 0; }
61 
62  };
63 
65  public:
68  m_nodesSucceeded = 0;
69  m_slotNum = -1;
70  };
73 
74  bool visitEnter(DecisionNode&) const override {return true;}
75 
76  bool visit(DecisionNode&) override {return true;}\
77 
78  bool visitLeave(DecisionNode&) const override {return true;}
79 
80 
81  bool visitEnter(AlgorithmNode&) const override {return true;}
82 
83  bool visit(AlgorithmNode& node) override;
84 
85 
86  void reset() override { m_nodesSucceeded = 0; }
87 
88  };
89 
91  public:
94  m_nodesSucceeded = 0;
95  m_slotNum = -1;
96  };
99 
100  bool visitEnter(DecisionNode&) const override {return true;}
101 
102  bool visit(DecisionNode&) override {return true;}
103 
104  bool visitLeave(DecisionNode&) const override {return true;}
105 
106 
107  bool visitEnter(AlgorithmNode&) const override {return true;}
108 
109  bool visit(AlgorithmNode& node) override;
110 
111 
112  void reset() override { m_nodesSucceeded = 0; }
113 
114  void runThroughAdjacents(boost::graph_traits<boost::ExecPlan>::vertex_descriptor vertex, boost::ExecPlan graph);
115 
116  };
117 
118  class RankerByTiming : public IGraphVisitor {
119  public:
122  m_nodesSucceeded = 0;
123  m_slotNum = -1;
124  };
126  ~RankerByTiming() override {}
127 
128  bool visitEnter(DecisionNode&) const override {return true;}
129 
130  bool visit(DecisionNode&) override {return true;}
131 
132  bool visitLeave(DecisionNode&) const override {return true;}
133 
134 
135  bool visitEnter(AlgorithmNode&) const override {return true;}
136 
137  bool visit(AlgorithmNode& node) override;
138 
139 
140  void reset() override { m_nodesSucceeded = 0; }
141 
142  };
143 
145  public:
148  m_nodesSucceeded = 0;
149  m_slotNum = -1;
150  };
152  ~RankerByEccentricity() override {}
153 
154  bool visitEnter(DecisionNode&) const override {return true;}
155 
156  bool visit(DecisionNode&) override {return true;}
157 
158  bool visitLeave(DecisionNode&) const override {return true;}
159 
160 
161  bool visitEnter(AlgorithmNode&) const override {return true;}
162 
163  bool visit(AlgorithmNode& node) override;
164 
165 
166  void reset() override { m_nodesSucceeded = 0; }
167 
168  };
169 
171  public:
174  m_nodesSucceeded = 0;
175  m_slotNum = -1;
176  m_currentDepth = 0;
177  m_maxKnownDepth = 0;
178  };
181 
182  bool visitEnter(DecisionNode&) const override {return true;}
183 
184  bool visit(DecisionNode&) override {return true;}
185 
186  bool visitLeave(DecisionNode&) const override {return true;}
187 
188 
189  bool visitEnter(AlgorithmNode&) const override {return true;}
190 
191  bool visit(AlgorithmNode& node) override;
192 
193 
194  void reset() override {
195  m_nodesSucceeded = 0;
196  m_currentDepth = 0;
197  m_maxKnownDepth = 0;
198  }
199 
202  void recursiveVisit(AlgorithmNode& node);
203 
206 
207  };
208 
209 }
210 
211 
212 
213 #endif /* EFGRAPHVISITORS_H_ */
~RankerByCummulativeOutDegree() override
Destructor.
bool visitLeave(DecisionNode &) const override
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, AlgoNodeStruct > ExecPlan
bool visitEnter(AlgorithmNode &) const override
bool visitEnter(AlgorithmNode &) const override
RunSimulator(const int &slotNum)
Constructor.
bool visit(DecisionNode &) override
bool visitLeave(DecisionNode &) const override
bool visit(DecisionNode &) override
A visitor, performing full top-down traversals of a graph.
bool visitLeave(DecisionNode &) const override
~RankerByEccentricity() override
Destructor.
bool visitEnter(DecisionNode &) const override
~RankerByDataRealmEccentricity() override
Destructor.
~Trigger() override
Destructor.
bool visitEnter(DecisionNode &node) const override
bool visitLeave(DecisionNode &) const override
bool visitEnter(AlgorithmNode &) const override
bool visitEnter(DecisionNode &) const override
bool visitEnter(AlgorithmNode &) const override
bool visitLeave(DecisionNode &node) const override
bool visit(DecisionNode &) override
bool visitEnter(AlgorithmNode &) const override
bool visitLeave(DecisionNode &) const override
bool visit(DecisionNode &) override
void reset() override
bool visitEnter(DecisionNode &) const override
Trigger(const int &slotNum)
Constructor.
~RankerByProductConsumption() override
Destructor.
~RunSimulator() override
Destructor.
bool visitEnter(DecisionNode &) const override
bool visitEnter(DecisionNode &) const override
bool visit(DecisionNode &) override
~RankerByTiming() override
Destructor.
bool visit(DecisionNode &node) override