| The Gaudi Framework v27r1

- 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/EFGraphVisitors.h>`

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

## Public Member Functions
| Trigger (const int &slotNum)
| Constructor. More...
virtual | ~Trigger ()
| Destructor. More...
virtual bool | visitEnter (DecisionNode &node) const
virtual bool | visit (DecisionNode &node)
virtual bool | visitLeave (DecisionNode &node) const
virtual bool | visitEnter (AlgorithmNode &node) const
virtual bool | visit (AlgorithmNode &node)
virtual void | reset ()
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 EFGraphVisitors.h.

## Constructor & Destructor Documentation

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

Constructor.

Definition at line 41 of file EFGraphVisitors.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

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

Destructor.

Definition at line 46 of file EFGraphVisitors.h.

46 {};

## Member Function Documentation

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

Implements concurrency::IGraphVisitor.

Definition at line 60 of file EFGraphVisitors.h.

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

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

Implements concurrency::IGraphVisitor.

Definition at line 97 of file EFGraphVisitors.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_isLazy) {
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 | ) |
| virtual

Implements concurrency::IGraphVisitor.

Definition at line 139 of file EFGraphVisitors.cpp.

139 {
140
141 bool result = false;
142
143 auto& decisions = node.m_graph->getNodeDecisions(m_slotNum);
144 auto& states = node.m_graph->getAlgoStates(m_slotNum);
145
146 if (node.promoteToControlReadyState(m_slotNum,states,decisions))
147 result = node.promoteToDataReadyState(m_slotNum);
148
149 return result;
150 }
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24

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

Implements concurrency::IGraphVisitor.

Definition at line 89 of file EFGraphVisitors.cpp.

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

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

Implements concurrency::IGraphVisitor.

Definition at line 131 of file EFGraphVisitors.cpp.

131 {
132
133 if (node.m_graph->getNodeDecisions(m_slotNum)[node.getNodeIndex()] != 1)
134 return true;
135 return false;
136 }
concurrency::IGraphVisitor::m_slotNum
int m_slotNum
Definition: IGraphVisitor.h:24

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

Implements concurrency::IGraphVisitor.

Definition at line 121 of file EFGraphVisitors.cpp.

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

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

- GaudiHive/src/EFGraphVisitors.h
- GaudiHive/src/EFGraphVisitors.cpp