| 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::DecisionNode Class Reference

`#include <src/PrecedenceRulesGraph.h>`

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

## Public Member Functions
| DecisionNode (PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name, bool modeConcurrent, bool modePromptDecision, bool modeOR, bool allPass)
| Constructor. More...
| ~DecisionNode () override
| Destructor. More...
bool | accept (IGraphVisitor &visitor) override
| Visitor entry point. More...
void | addParentNode (DecisionNode *node)
| Add a parent node. More...
void | addDaughterNode (ControlFlowNode *node)
| Add a daughter node. More...
const std::vector< ControlFlowNode * > & | getDaughters () const
| Get children nodes. 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::ControlFlowNode
| ControlFlowNode (PrecedenceRulesGraph &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...

## Public Attributes
bool | m_modeConcurrent
| Whether all daughters will be evaluated concurrently or sequentially. More...
bool | m_modePromptDecision
| Whether to evaluate the hub decision ASA its child decisions allow to do that. More...
bool | m_modeOR
| Whether acting as "and" (false) or "or" node (true) More...
bool | m_allPass
| Whether always passing regardless of daughter results. More...
std::vector< ControlFlowNode * > | m_children
| All direct daughter nodes in the tree. More...
std::vector< DecisionNode * > | m_parents
| Direct parent nodes. More...
Public Attributes inherited from concurrency::ControlFlowNode
PrecedenceRulesGraph * | m_graph

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

## Detailed Description

Definition at line 364 of file PrecedenceRulesGraph.h.

## Constructor & Destructor Documentation

concurrency::DecisionNode::DecisionNode | ( | PrecedenceRulesGraph & | graph,
|  | unsigned int | nodeIndex,
|  | const std::string & | name,
|  | bool | modeConcurrent,
|  | bool | modePromptDecision,
|  | bool | modeOR,
|  | bool | allPass
| ) |  |
| inline

Constructor.

Definition at line 368 of file PrecedenceRulesGraph.h.

370 : ControlFlowNode( graph, nodeIndex, name )
371 , m_modeConcurrent( modeConcurrent )
372 , m_modePromptDecision( modePromptDecision )
373 , m_modeOR( modeOR )
374 , m_allPass( allPass )
375 , m_children()
376 {
377 }
concurrency::ControlFlowNode::ControlFlowNode
ControlFlowNode(PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name)
Constructor.
Definition: PrecedenceRulesGraph.h:337
concurrency::DecisionNode::m_children
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.
Definition: PrecedenceRulesGraph.h:405
concurrency::DecisionNode::m_allPass
bool m_allPass
Whether always passing regardless of daughter results.
Definition: PrecedenceRulesGraph.h:403
concurrency::DecisionNode::m_modeOR
bool m_modeOR
Whether acting as "and" (false) or "or" node (true)
Definition: PrecedenceRulesGraph.h:401
concurrency::DecisionNode::m_modePromptDecision
bool m_modePromptDecision
Whether to evaluate the hub decision ASA its child decisions allow to do that.
Definition: PrecedenceRulesGraph.h:399
plotSpeedupsPyRoot.graph
graph
Definition: plotSpeedupsPyRoot.py:142
concurrency::DecisionNode::m_modeConcurrent
bool m_modeConcurrent
Whether all daughters will be evaluated concurrently or sequentially.
Definition: PrecedenceRulesGraph.h:396

concurrency::DecisionNode::~DecisionNode | ( |  | ) |
| override

Destructor.

Definition at line 28 of file PrecedenceRulesGraph.cpp.

29 {
30
31 for ( auto node : m_children ) delete node;
32 }
concurrency::DecisionNode::m_children
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.
Definition: PrecedenceRulesGraph.h:405

## Member Function Documentation

bool concurrency::DecisionNode::accept | ( | IGraphVisitor & | visitor | ) |
| override virtual

Visitor entry point.

Implements concurrency::ControlFlowNode.

Definition at line 61 of file PrecedenceRulesGraph.cpp.

62 {
63
64 if ( visitor.visitEnter( *this ) ) {
65 // try to aggregate a decision
66 bool result = visitor.visit( *this );
67
68 // if a decision was made for this node, propagate the result upwards
69 if ( result ) {
70 for ( auto parent : m_parents ) {
71 parent->accept( visitor );
72 }
73 return false;
74 }
75
76 // if no decision can be made yet, request further information downwards
77 for ( auto child : m_children ) {
78 bool result = child->accept( visitor );
79 if ( !m_modeConcurrent )
80 if ( result ) break; // stop on first unresolved child if its decision hub is sequential
81 }
82
83 return true; // visitor was accepted to try to aggregate the node's decision
84 }
85
86 return false; // visitor was rejected (since the decision node has an aggregated decision already)
87 }
concurrency::DecisionNode::m_parents
std::vector< DecisionNode * > m_parents
Direct parent nodes.
Definition: PrecedenceRulesGraph.h:407
concurrency::DecisionNode::m_children
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.
Definition: PrecedenceRulesGraph.h:405
concurrency::DecisionNode::m_modeConcurrent
bool m_modeConcurrent
Whether all daughters will be evaluated concurrently or sequentially.
Definition: PrecedenceRulesGraph.h:396

void concurrency::DecisionNode::addDaughterNode | ( | ControlFlowNode * | node | ) |

Add a daughter node.

Definition at line 42 of file PrecedenceRulesGraph.cpp.

43 {
44
45 if ( std::find( m_children.begin(), m_children.end(), node ) == m_children.end() ) m_children.push_back( node );
46 }
concurrency::DecisionNode::m_children
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.
Definition: PrecedenceRulesGraph.h:405
std::find
T find(T...args)

void concurrency::DecisionNode::addParentNode | ( | DecisionNode * | node | ) |

Add a parent node.

Definition at line 35 of file PrecedenceRulesGraph.cpp.

36 {
37
38 if ( std::find( m_parents.begin(), m_parents.end(), node ) == m_parents.end() ) m_parents.push_back( node );
39 }
concurrency::DecisionNode::m_parents
std::vector< DecisionNode * > m_parents
Direct parent nodes.
Definition: PrecedenceRulesGraph.h:407
std::find
T find(T...args)

const std::vector<ControlFlowNode*>& concurrency::DecisionNode::getDaughters | ( |  | ) | const
| inline

Get children nodes.

Definition at line 389 of file PrecedenceRulesGraph.h.

389 { return m_children; }
concurrency::DecisionNode::m_children
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.
Definition: PrecedenceRulesGraph.h:405

void concurrency::DecisionNode::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::ControlFlowNode.

Definition at line 49 of file PrecedenceRulesGraph.cpp.

51 {
52
53 output << std::string( recursionLevel, ' ' ) << m_nodeName << " (" << m_nodeIndex << ")"
54 << ", w/ decision: " << stateToString( node_decisions[m_nodeIndex] ) << "(" << node_decisions[m_nodeIndex]
55 << ")" << std::endl;
56
57 for ( auto daughter : m_children ) daughter->printState( output, states, node_decisions, recursionLevel + 2 );
58 }
concurrency::DecisionNode::m_children
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.
Definition: PrecedenceRulesGraph.h:405
std::endl
T endl(T...args)
concurrency::ControlFlowNode::stateToString
std::string stateToString(const int &stateId) const
Translation between state id and name.
Definition: PrecedenceRulesGraph.cpp:16
std::string
STL class.
concurrency::ControlFlowNode::m_nodeIndex
unsigned int m_nodeIndex
Definition: PrecedenceRulesGraph.h:360
concurrency::ControlFlowNode::m_nodeName
std::string m_nodeName
Definition: PrecedenceRulesGraph.h:361

## Member Data Documentation

bool concurrency::DecisionNode::m_allPass

Whether always passing regardless of daughter results.

Definition at line 403 of file PrecedenceRulesGraph.h.

std::vector<ControlFlowNode*> concurrency::DecisionNode::m_children

All direct daughter nodes in the tree.

Definition at line 405 of file PrecedenceRulesGraph.h.

bool concurrency::DecisionNode::m_modeConcurrent

Whether all daughters will be evaluated concurrently or sequentially.

Definition at line 396 of file PrecedenceRulesGraph.h.

bool concurrency::DecisionNode::m_modeOR

Whether acting as "and" (false) or "or" node (true)

Definition at line 401 of file PrecedenceRulesGraph.h.

bool concurrency::DecisionNode::m_modePromptDecision

Whether to evaluate the hub decision ASA its child decisions allow to do that.

Applicable to both concurrent and sequential cases.

Definition at line 399 of file PrecedenceRulesGraph.h.

std::vector<DecisionNode*> concurrency::DecisionNode::m_parents

Direct parent nodes.

Definition at line 407 of file PrecedenceRulesGraph.h.

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

- GaudiHive/src/PrecedenceRulesGraph.h
- GaudiHive/src/PrecedenceRulesGraph.cpp