All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ExecutionFlowManager.h
Go to the documentation of this file.
1 #ifndef EXECUTIONFLOWMANAGER_H_
2 #define EXECUTIONFLOWMANAGER_H_
3 
4 #include "ExecutionFlowGraph.h"
5 #include "EFGraphVisitors.h"
6 
7 namespace concurrency {
8 
11  };
12 
21  class ExecutionFlowManager : public CommonMessaging<IExecutionFlowManager> {
22  public:
24  ExecutionFlowManager() : m_name("ExecutionFlowManager"), m_EFGraph(0) {};
26  ~ExecutionFlowManager() override = default;
29  StatusCode initialize(ExecutionFlowGraph* CFGraph,
30  const std::unordered_map<std::string,unsigned int>& algname_index_map);
31  StatusCode initialize(ExecutionFlowGraph* CFGraph,
32  const std::unordered_map<std::string,unsigned int>& algname_index_map,
33  std::vector<EventSlot>& eventSlots,
34  const std::string& mode);
36  void simulateExecutionFlow(IGraphVisitor& visitor) const;
38  inline ExecutionFlowGraph* getExecutionFlowGraph() const {return m_EFGraph;}
40  bool needsAlgorithmToRun(const unsigned int iAlgo) const;
42  void updateEventState(AlgsExecutionStates & algo_states,
43  std::vector<int>& node_decisions) const;
45  void updateDecision(const std::string& algo_name,
46  const int& slotNum,
47  AlgsExecutionStates& states,
48  std::vector<int>& node_decisions) const;
50  void updateEventState(AlgsExecutionStates& algo_states) const;
52  void promoteToControlReadyState(AlgsExecutionStates& algo_states,
53  std::vector<int>& node_decisions,
54  const int& slotNum=-1) const;
56  bool algoDataDependenciesSatisfied(const std::string& algo_name, const int& slotNum) const;
58  bool rootDecisionResolved(const std::vector<int>& node_decisions) const;
61  AlgsExecutionStates& states,
62  const std::vector<int>& node_decisions,
63  const unsigned int& recursionLevel) const {m_EFGraph->printState(ss,states,node_decisions,recursionLevel);}
65  void touchReadyAlgorithms(IGraphVisitor& visitor) const;
67  const std::string& name() const override {return m_name;}
69  SmartIF<ISvcLocator>& serviceLocator() const override {return m_EFGraph->serviceLocator();}
70  private:
74  };
75 
76 } // namespace concurrency
77 
78 #endif /* EXECUTIONFLOWMANAGER_H_ */
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
void printEventState(std::stringstream &ss, AlgsExecutionStates &states, const std::vector< int > &node_decisions, const unsigned int &recursionLevel) const
Print the state of the control flow for a given event.
const std::string & name() const override
Retrieve name of the service.
STL class.
The AlgsExecutionStates encodes the state machine for the execution of algorithms within a single eve...
Manage the execution flow using an execution flow graph Once initialized, the graph is const and can ...
ExecutionFlowGraph * m_EFGraph
the control flow graph
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
ExecutionFlowGraph * getExecutionFlowGraph() const
Get the flow graph instance.