The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
concurrency::DecisionNode Class Referencefinal

#include </builds/gaudi/Gaudi/GaudiHive/src/PRGraph/PrecedenceRulesGraph.h>

Inheritance diagram for concurrency::DecisionNode:
Collaboration diagram for concurrency::DecisionNode:

Public Member Functions

 DecisionNode (PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name, Concurrent modeConcurrent, PromptDecision modePromptDecision, ModeOr modeOR, AllPass allPass, Inverted isInverted)
 Constructor.
 
bool accept (IGraphVisitor &visitor) override
 Visitor entry point.
 
void addParentNode (DecisionNode *node)
 Add a parent node.
 
void addDaughterNode (ControlFlowNode *node)
 Add a daughter node.
 
const std::vector< ControlFlowNode * > & getDaughters () const
 Get children nodes.
 
void printState (std::stringstream &output, EventSlot &slot, const unsigned int &recursionLevel) const override
 Print a string representing the control flow state.
 
- Public Member Functions inherited from concurrency::ControlFlowNode
 ControlFlowNode (PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name)
 Constructor.
 
virtual ~ControlFlowNode ()=default
 Destructor.
 
const unsigned int & getNodeIndex () const
 Get node index.
 
const std::string & name () const
 Get node name.
 

Public Attributes

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

Additional Inherited Members

- Protected Attributes inherited from concurrency::ControlFlowNode
unsigned int m_nodeIndex
 
std::string m_nodeName
 

Detailed Description

Definition at line 440 of file PrecedenceRulesGraph.h.

Constructor & Destructor Documentation

◆ DecisionNode()

concurrency::DecisionNode::DecisionNode ( PrecedenceRulesGraph & graph,
unsigned int nodeIndex,
const std::string & name,
Concurrent modeConcurrent,
PromptDecision modePromptDecision,
ModeOr modeOR,
AllPass allPass,
Inverted isInverted )
inline

Constructor.

Definition at line 443 of file PrecedenceRulesGraph.h.

446 : ControlFlowNode( graph, nodeIndex, name )
447 , m_modeConcurrent( modeConcurrent )
448 , m_modePromptDecision( modePromptDecision )
449 , m_modeOR( modeOR )
450 , m_allPass( allPass )
451 , m_inverted( isInverted ) {}
ControlFlowNode(PrecedenceRulesGraph &graph, unsigned int nodeIndex, const std::string &name)
Constructor.
const std::string & name() const
Get node name.
bool m_modeOR
Whether acting as "and" (false) or "or" node (true)
bool m_modeConcurrent
Whether all daughters will be evaluated concurrently or sequentially.
bool m_inverted
Whether the selection result is negated or not.
bool m_allPass
Whether always passing regardless of daughter results.
bool m_modePromptDecision
Whether to evaluate the hub decision ASA its child decisions allow to do that.

Member Function Documentation

◆ accept()

bool concurrency::DecisionNode::accept ( IGraphVisitor & visitor)
overridevirtual

Visitor entry point.

Implements concurrency::ControlFlowNode.

Definition at line 65 of file PrecedenceRulesGraph.cpp.

65 {
66
67 if ( visitor.visitEnter( *this ) ) {
68 // try to aggregate a decision
69 bool result = visitor.visit( *this );
70 return !result;
71 }
72
73 return false; // visitor was rejected (since the decision node has an aggregated decision already)
74 }

◆ addDaughterNode()

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

Add a daughter node.

Definition at line 47 of file PrecedenceRulesGraph.cpp.

47 {
48
49 if ( std::find( m_children.begin(), m_children.end(), node ) == m_children.end() ) m_children.push_back( node );
50 }
std::vector< ControlFlowNode * > m_children
All direct daughter nodes in the tree.

◆ addParentNode()

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

Add a parent node.

Definition at line 41 of file PrecedenceRulesGraph.cpp.

41 {
42
43 if ( std::find( m_parents.begin(), m_parents.end(), node ) == m_parents.end() ) m_parents.push_back( node );
44 }
std::vector< DecisionNode * > m_parents
Direct parent nodes.

◆ getDaughters()

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

Get children nodes.

Definition at line 460 of file PrecedenceRulesGraph.h.

460{ return m_children; }

◆ printState()

void concurrency::DecisionNode::printState ( std::stringstream & output,
EventSlot & slot,
const unsigned int & recursionLevel ) const
overridevirtual

Print a string representing the control flow state.

Implements concurrency::ControlFlowNode.

Definition at line 53 of file PrecedenceRulesGraph.cpp.

54 {
55
56 auto& node_decisions = slot.controlFlowState;
57 output << std::string( recursionLevel, ' ' ) << m_nodeName << " (" << m_nodeIndex << ")"
58 << ", w/ decision: " << stateToString( node_decisions[m_nodeIndex] ) << "(" << node_decisions[m_nodeIndex]
59 << ")" << std::endl;
60
61 for ( auto daughter : m_children ) daughter->printState( output, slot, recursionLevel + 2 );
62 }
std::vector< int > controlFlowState
State of the control flow.
Definition EventSlot.h:86

Member Data Documentation

◆ m_allPass

bool concurrency::DecisionNode::m_allPass

Whether always passing regardless of daughter results.

Definition at line 473 of file PrecedenceRulesGraph.h.

◆ m_children

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

All direct daughter nodes in the tree.

Definition at line 477 of file PrecedenceRulesGraph.h.

◆ m_inverted

bool concurrency::DecisionNode::m_inverted { false }

Whether the selection result is negated or not.

Definition at line 475 of file PrecedenceRulesGraph.h.

475{ false };

◆ m_modeConcurrent

bool concurrency::DecisionNode::m_modeConcurrent

Whether all daughters will be evaluated concurrently or sequentially.

Definition at line 466 of file PrecedenceRulesGraph.h.

◆ m_modeOR

bool concurrency::DecisionNode::m_modeOR

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

Definition at line 471 of file PrecedenceRulesGraph.h.

◆ m_modePromptDecision

bool concurrency::DecisionNode::m_modePromptDecision

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

Applicable to "sequential" hub only.

Definition at line 469 of file PrecedenceRulesGraph.h.

◆ m_parents

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

Direct parent nodes.

Definition at line 479 of file PrecedenceRulesGraph.h.


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