| The Gaudi Framework v29r0 (ff2e7097)

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

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

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

`#include <src/PRGraphVisitors.h>`

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

## Public Member Functions
| DecisionUpdater (EventSlot &slot, const Cause &cause, bool ifTrace=false)
| Constructor. More...
bool | visit (AlgorithmNode &) override
Public Member Functions inherited from concurrency::IGraphVisitor
virtual | ~IGraphVisitor ()=default
virtual bool | visitEnter (DecisionNode &) const
virtual bool | visit (DecisionNode &)
virtual bool | visitEnter (AlgorithmNode &) const
virtual bool | visitEnter (DataNode &) const
virtual bool | visit (DataNode &)
virtual bool | visitEnter (ConditionNode &) const
virtual bool | visit (ConditionNode &)
virtual void | reset ()

## Public Attributes
EventSlot * | m_slot
Cause | m_cause
bool | m_trace

## Detailed Description

Definition at line 38 of file PRGraphVisitors.h.

## Constructor & Destructor Documentation

concurrency::DecisionUpdater::DecisionUpdater | ( | EventSlot & | slot,
|  | const Cause & | cause,
|  | bool | ifTrace = `false`
| ) |  |
| inline

Constructor.

Definition at line 42 of file PRGraphVisitors.h.

43 : m_slot( &slot ), m_cause( cause ), m_trace( ifTrace ){};
concurrency::DecisionUpdater::m_slot
EventSlot * m_slot
Definition: PRGraphVisitors.h:49
concurrency::DecisionUpdater::m_trace
bool m_trace
Definition: PRGraphVisitors.h:51
concurrency::DecisionUpdater::m_cause
Cause m_cause
Definition: PRGraphVisitors.h:50

## Member Function Documentation

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 100 of file PRGraphVisitors.cpp.

101 {
102
103 auto& states = m_slot->algsStates;
104 const State& state = states[node.getAlgoIndex()];
105 int decision = -1;
106
107 if ( true == node.isOptimist() )
108 decision = 1;
109 else if ( State::EVTACCEPTED == state )
110 decision = !node.isLiar();
111 else if ( State::EVTREJECTED == state )
112 decision = node.isLiar();
113
114 if ( -1 != decision ) {
115
116 m_slot->controlFlowState[node.getNodeIndex()] = decision;
117
118 auto promoter = DataReadyPromoter( *m_slot, m_cause, m_trace );
119 for ( const auto& output : node.getOutputDataNodes() )
120 for ( auto& consumer : output->getConsumers() ) consumer->accept( promoter );
121
122 auto vis = concurrency::Supervisor( *m_slot, m_cause, m_trace );
123 for ( auto& p : node.getParentDecisionHubs() ) p->accept( vis );
124
125 return true; // return true only if the algorithm produced a decision
126 }
127
128 return false;
129 }
compareRootHistos.state
state
Definition: compareRootHistos.py:422
gaudirun.output
output
Definition: gaudirun.py:404
EventSlot::algsStates
AlgsExecutionStates algsStates
Vector of algorithms states.
Definition: EventSlot.h:37
concurrency::DecisionUpdater::m_slot
EventSlot * m_slot
Definition: PRGraphVisitors.h:49
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:43
concurrency::DecisionUpdater::m_trace
bool m_trace
Definition: PRGraphVisitors.h:51
concurrency::DecisionUpdater::m_cause
Cause m_cause
Definition: PRGraphVisitors.h:50
concurrency::Supervisor
Definition: PRGraphVisitors.h:54
AlgsExecutionStates::State
State
Execution states of the algorithms.
Definition: AlgsExecutionStates.h:32

## Member Data Documentation

Cause concurrency::DecisionUpdater::m_cause

Definition at line 50 of file PRGraphVisitors.h.

EventSlot* concurrency::DecisionUpdater::m_slot

Definition at line 49 of file PRGraphVisitors.h.

bool concurrency::DecisionUpdater::m_trace

Definition at line 51 of file PRGraphVisitors.h.

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

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