| The Gaudi Framework v29r0 (ff2e7097)

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

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

Public Member Functions | Private Attributes | List of all members
concurrency::recursive_CF::AlgorithmNode Class Reference

`#include <src/ControlFlowGraph.h>`

Inheritance diagram for concurrency::recursive_CF::AlgorithmNode:
[legend]
Collaboration diagram for concurrency::recursive_CF::AlgorithmNode:
[legend]

## Public Member Functions
| AlgorithmNode (ControlFlowGraph &graph, Algorithm *algoPtr, unsigned int nodeIndex, unsigned int algoIndex, bool inverted, bool allPass)
| Constructor. More...
void | initialize (const std::unordered_map< std::string, unsigned int > &algname_index_map) override
| Initialize. More...
Algorithm * | getAlgorithm () const
| get Algorithm representatives More...
int | updateState (AlgsExecutionStates &states, std::vector< int > &node_decisions) const override
| Method to set algos to CONTROLREADY, if possible. More...
void | printState (std::stringstream &output, AlgsExecutionStates &states, const std::vector< int > &node_decisions, const unsigned int &recursionLevel) const override
| Print a string representing the control flow state. More...
Public Member Functions inherited from concurrency::recursive_CF::ControlFlowNode
| ControlFlowNode (ControlFlowGraph &graph, unsigned int nodeIndex, const std::string &name)
| Constructor. More...
virtual | ~ControlFlowNode ()
| Destructor. More...
const unsigned int & | getNodeIndex () const
| Get node index. More...
const std::string & | getNodeName () const
| Get node name. More...

## Private Attributes
unsigned int | m_algoIndex
| The index of the algorithm. More...
std::string | m_algoName
| The name of the algorithm. More...
bool | m_inverted
| Whether the selection result is negated or not. More...
bool | m_allPass
| Whether the selection result is relevant or always "pass". More...
Algorithm * | m_algorithm
| Algorithm representative behind the AlgorithmNode. More...

## Additional Inherited Members
Public Attributes inherited from concurrency::recursive_CF::ControlFlowNode
ControlFlowGraph * | m_graph
Protected Member Functions inherited from concurrency::recursive_CF::ControlFlowNode
std::string | stateToString (const int &stateId) const
| Translation between state id and name. More...
Protected Attributes inherited from concurrency::recursive_CF::ControlFlowNode
unsigned int | m_nodeIndex
std::string | m_nodeName

## Detailed Description

Definition at line 101 of file ControlFlowGraph.h.

## Constructor & Destructor Documentation

concurrency::recursive_CF::AlgorithmNode::AlgorithmNode | ( | ControlFlowGraph & | graph,
|  | Algorithm * | algoPtr,
|  | unsigned int | nodeIndex,
|  | unsigned int | algoIndex,
|  | bool | inverted,
|  | bool | allPass
| ) |  |
| inline

Constructor.

Definition at line 105 of file ControlFlowGraph.h.

107 : ControlFlowNode( graph, nodeIndex, algoPtr->name() )
108 , m_algoIndex( algoIndex )
109 , m_algoName( algoPtr->name() )
110 , m_inverted( inverted )
111 , m_allPass( allPass )
112 , m_algorithm( algoPtr ){};
Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:731
concurrency::recursive_CF::AlgorithmNode::m_algorithm
Algorithm * m_algorithm
Algorithm representative behind the AlgorithmNode.
Definition: ControlFlowGraph.h:134
concurrency::recursive_CF::AlgorithmNode::m_algoName
std::string m_algoName
The name of the algorithm.
Definition: ControlFlowGraph.h:128
concurrency::recursive_CF::ControlFlowNode::ControlFlowNode
ControlFlowNode(ControlFlowGraph &graph, unsigned int nodeIndex, const std::string &name)
Constructor.
Definition: ControlFlowGraph.h:29
concurrency::recursive_CF::AlgorithmNode::m_allPass
bool m_allPass
Whether the selection result is relevant or always "pass".
Definition: ControlFlowGraph.h:132
concurrency::recursive_CF::AlgorithmNode::m_inverted
bool m_inverted
Whether the selection result is negated or not.
Definition: ControlFlowGraph.h:130
plotSpeedupsPyRoot.graph
graph
Definition: plotSpeedupsPyRoot.py:142
concurrency::recursive_CF::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: ControlFlowGraph.h:126

## Member Function Documentation

Algorithm* concurrency::recursive_CF::AlgorithmNode::getAlgorithm | ( |  | ) | const
| inline

get Algorithm representatives

Definition at line 117 of file ControlFlowGraph.h.

117 { return m_algorithm; }
concurrency::recursive_CF::AlgorithmNode::m_algorithm
Algorithm * m_algorithm
Algorithm representative behind the AlgorithmNode.
Definition: ControlFlowGraph.h:134

void concurrency::recursive_CF::AlgorithmNode::initialize | ( | const std::unordered_map< std::string, unsigned int > & | algname_index_map | ) |
| override virtual

Initialize.

Implements concurrency::recursive_CF::ControlFlowNode.

Definition at line 97 of file ControlFlowGraph.cpp.

98 {
99
100 m_algoIndex = algname_index_map.at( m_algoName );
101 }
concurrency::recursive_CF::AlgorithmNode::m_algoName
std::string m_algoName
The name of the algorithm.
Definition: ControlFlowGraph.h:128
std::unordered_map::at
T at(T...args)
concurrency::recursive_CF::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: ControlFlowGraph.h:126

void concurrency::recursive_CF::AlgorithmNode::printState | ( | std::stringstream & | output,
|  | AlgsExecutionStates & | states,
|  | const std::vector< int > & | node_decisions,
|  | const unsigned int & | recursionLevel
| ) |  | const
| override virtual

Print a string representing the control flow state.

Implements concurrency::recursive_CF::ControlFlowNode.

Definition at line 104 of file ControlFlowGraph.cpp.

106 {
107 output << std::string( recursionLevel, ' ' ) << m_nodeName << " (" << m_nodeIndex << ")"
108 << ", w/ decision: " << stateToString( node_decisions[m_nodeIndex] ) << "(" << node_decisions[m_nodeIndex]
109 << ")"
110 << ", in state: " << AlgsExecutionStates::stateNames[states[m_algoIndex]] << std::endl;
111 }
concurrency::recursive_CF::ControlFlowNode::stateToString
std::string stateToString(const int &stateId) const
Translation between state id and name.
Definition: ControlFlowGraph.cpp:11
std::endl
T endl(T...args)
std::string
STL class.
concurrency::recursive_CF::ControlFlowNode::m_nodeName
std::string m_nodeName
Definition: ControlFlowGraph.h:54
concurrency::recursive_CF::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: ControlFlowGraph.h:126
AlgsExecutionStates::stateNames
static std::map< State, std::string > stateNames
Definition: AlgsExecutionStates.h:42
concurrency::recursive_CF::ControlFlowNode::m_nodeIndex
unsigned int m_nodeIndex
Definition: ControlFlowGraph.h:53

int concurrency::recursive_CF::AlgorithmNode::updateState | ( | AlgsExecutionStates & | states,
|  | std::vector< int > & | node_decisions
| ) |  | const
| override virtual

Method to set algos to CONTROLREADY, if possible.

Implements concurrency::recursive_CF::ControlFlowNode.

Definition at line 114 of file ControlFlowGraph.cpp.

115 {
116 // check whether we already had a result earlier
117 // if (-1 != node_decisions[m_nodeIndex] ) { return node_decisions[m_nodeIndex]; }
118 // since we reached this point in the control flow, this algorithm is supposed to run
119 // if it hasn't already
120 const State& state = states[m_algoIndex];
121 unsigned int decision = -1;
122 if ( State::INITIAL == state ) {
123 states.updateState( m_algoIndex, State::CONTROLREADY ).ignore();
124 }
125 // now derive the proper result to pass back
126 if ( true == m_allPass ) {
127 decision = 1;
128 } else if ( State::EVTACCEPTED == state ) {
129 decision = !m_inverted;
130 } else if ( State::EVTREJECTED == state ) {
131 decision = m_inverted;
132 } else {
133 decision = -1; // result not known yet
134 }
135 node_decisions[m_nodeIndex] = decision;
136 return decision;
137 }
compareRootHistos.state
state
Definition: compareRootHistos.py:422
concurrency::recursive_CF::AlgorithmNode::m_allPass
bool m_allPass
Whether the selection result is relevant or always "pass".
Definition: ControlFlowGraph.h:132
concurrency::recursive_CF::AlgorithmNode::m_inverted
bool m_inverted
Whether the selection result is negated or not.
Definition: ControlFlowGraph.h:130
StatusCode::ignore
void ignore() const
Definition: StatusCode.h:109
concurrency::recursive_CF::AlgorithmNode::m_algoIndex
unsigned int m_algoIndex
The index of the algorithm.
Definition: ControlFlowGraph.h:126
AlgsExecutionStates::State
State
Execution states of the algorithms.
Definition: AlgsExecutionStates.h:32
concurrency::recursive_CF::ControlFlowNode::m_nodeIndex
unsigned int m_nodeIndex
Definition: ControlFlowGraph.h:53
AlgsExecutionStates::updateState
StatusCode updateState(unsigned int iAlgo, State newState)
Definition: AlgsExecutionStates.cpp:8

## Member Data Documentation

unsigned int concurrency::recursive_CF::AlgorithmNode::m_algoIndex
| private

The index of the algorithm.

Definition at line 126 of file ControlFlowGraph.h.

std::string concurrency::recursive_CF::AlgorithmNode::m_algoName
| private

The name of the algorithm.

Definition at line 128 of file ControlFlowGraph.h.

Algorithm* concurrency::recursive_CF::AlgorithmNode::m_algorithm
| private

Algorithm representative behind the AlgorithmNode.

Definition at line 134 of file ControlFlowGraph.h.

bool concurrency::recursive_CF::AlgorithmNode::m_allPass
| private

Whether the selection result is relevant or always "pass".

Definition at line 132 of file ControlFlowGraph.h.

bool concurrency::recursive_CF::AlgorithmNode::m_inverted
| private

Whether the selection result is negated or not.

Definition at line 130 of file ControlFlowGraph.h.

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

- GaudiHive/src/ControlFlowGraph.h
- GaudiHive/src/ControlFlowGraph.cpp