| The Gaudi Framework v28r2p1 (f1a77ff4)

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

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
concurrency::Trigger Class Reference

A visitor, performing full top-down traversals of a graph. More...

`#include <src/PRGraphVisitors.h>`

Inheritance diagram for concurrency::Trigger:
[legend]
Collaboration diagram for concurrency::Trigger:
[legend]

## Public Member Functions
| Trigger (const int &slotNum)
| Constructor. More...
| ~Trigger () override
| Destructor. More...
bool | visitEnter (DecisionNode &node) const override
bool | visit (DecisionNode &node) override
bool | visitLeave (DecisionNode &) const override
bool | visitEnter (AlgorithmNode &node) const override
bool | visit (AlgorithmNode &node) override
void | reset () override
Public Member Functions inherited from concurrency::IGraphVisitor
virtual | ~IGraphVisitor ()

## Additional Inherited Members
Public Attributes inherited from concurrency::IGraphVisitor
int | m_nodesSucceeded
int | m_slotNum

## Detailed Description

A visitor, performing full top-down traversals of a graph.

Definition at line 38 of file PRGraphVisitors.h.

## Constructor & Destructor Documentation

concurrency::Trigger::Trigger | ( | const int & | slotNum | ) |
| inline

Constructor.

Definition at line 41 of file PRGraphVisitors.h.

41 {
42 m_nodesSucceeded = 0;
43 m_slotNum = slotNum;
44 };
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24
concurrency::IGraphVisitor::m_nodesSucceeded
int m_nodesSucceeded
Definition: IGraphVisitor.h:23

concurrency::Trigger::~Trigger | ( |  | ) |
| inline override

Destructor.

Definition at line 46 of file PRGraphVisitors.h.

46 {}

## Member Function Documentation

void concurrency::Trigger::reset | ( |  | ) |
| inline override virtual

Implements concurrency::IGraphVisitor.

Definition at line 60 of file PRGraphVisitors.h.

60 { m_nodesSucceeded = 0; }
concurrency::IGraphVisitor::m_nodesSucceeded
int m_nodesSucceeded
Definition: IGraphVisitor.h:23

bool concurrency::Trigger::visit | ( | DecisionNode & | node | ) |
| override virtual

Implements concurrency::IGraphVisitor.

Definition at line 97 of file PRGraphVisitors.cpp.

97 {
98
99 //std::cout << "1-st level Decision: " << node.getNodeName() << std::endl;
100 bool allChildDecisionsResolved = true;
101 for (auto child : node.getDaughters()) {
102 int& childDecision = child->m_graph->getNodeDecisions(m_slotNum)[child->getNodeIndex()];
103
104 if (childDecision == 1 && node.m_modeOR && node.m_modePromptDecision) {
105 node.m_graph->getNodeDecisions(m_slotNum)[node.getNodeIndex()] = 1;
106 return true;
107 }
108
109 if (childDecision == -1) {
110 allChildDecisionsResolved = false;
111 }
112 }
113
114 if (allChildDecisionsResolved)
115 node.m_graph->getNodeDecisions(m_slotNum)[node.getNodeIndex()] = 1;
116
117 return allChildDecisionsResolved;
118 }
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24

bool concurrency::Trigger::visit | ( | AlgorithmNode & | node | ) |
| override virtual

Implements concurrency::IGraphVisitor.

Definition at line 131 of file PRGraphVisitors.cpp.

131 {
132
133 bool result = false;
134
135 auto& decisions = node.m_graph->getNodeDecisions(m_slotNum);
136 auto& states = node.m_graph->getAlgoStates(m_slotNum);
137
138 // Try to shift an algorithm with I->CF, and then, if successful, with CF->DF
139 if (node.promoteToControlReadyState(m_slotNum,states,decisions))
140 result = node.promoteToDataReadyState(m_slotNum);
141
142 //returns true only when an algorithm is DF-ready
143 // i.e., the visitor reached its final goal with the algorithm
144 return result;
145 }
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24

bool concurrency::Trigger::visitEnter | ( | DecisionNode & | node | ) | const
| override virtual

Implements concurrency::IGraphVisitor.

Definition at line 89 of file PRGraphVisitors.cpp.

89 {
90
91 if (node.m_graph->getNodeDecisions(m_slotNum)[node.getNodeIndex()] != -1)
92 return false;
93 return true;
94 }
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24

bool concurrency::Trigger::visitEnter | ( | AlgorithmNode & | node | ) | const
| override virtual

Implements concurrency::IGraphVisitor.

Definition at line 123 of file PRGraphVisitors.cpp.

123 {
124
125 if (node.m_graph->getNodeDecisions(m_slotNum)[node.getNodeIndex()] != -1)
126 return false;
127 return true;
128 }
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24

bool concurrency::Trigger::visitLeave | ( | DecisionNode & |  | ) | const
| inline override virtual

Implements concurrency::IGraphVisitor.

Definition at line 52 of file PRGraphVisitors.h.

52 {return true;};

The documentation for this class was generated from the following files:

- GaudiHive/src/PRGraphVisitors.h
- GaudiHive/src/PRGraphVisitors.cpp