The Gaudi Framework  master (37c0b60a)
concurrency::ActiveLineageScout Class Reference

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

Inheritance diagram for concurrency::ActiveLineageScout:
Collaboration diagram for concurrency::ActiveLineageScout:

Public Member Functions

 ActiveLineageScout (const EventSlot *slot, const ControlFlowNode &node)
 Constructor. More...
 
bool visitEnter (AlgorithmNode &) const override
 
bool visitEnter (DataNode &) const override
 
bool visitEnter (ConditionNode &) const override
 
bool visit (DecisionNode &) override
 
void reset () override
 
virtual bool reply () const
 
virtual void visitParents (DecisionNode &)
 
virtual bool visit (DecisionNode &)
 
virtual bool visit (AlgorithmNode &)
 
virtual bool visit (DataNode &)
 
virtual bool visit (ConditionNode &)
 
virtual bool visitEnter (DecisionNode &) const
 
virtual bool visitEnter (AlgorithmNode &) const
 
virtual bool visitEnter (DataNode &) const
 
virtual bool visitEnter (ConditionNode &) const
 
- Public Member Functions inherited from concurrency::IGraphVisitor
virtual ~IGraphVisitor ()=default
 
virtual bool visitEnter (DecisionNode &) const
 
virtual bool visit (AlgorithmNode &)
 
virtual bool visit (DataNode &)
 
virtual bool visit (ConditionNode &)
 

Protected Attributes

const EventSlotm_slot
 
const ControlFlowNodem_startNode
 
bool m_active { true }
 
std::string m_previousNodeName
 

Detailed Description

Definition at line 52 of file Validators.h.

Constructor & Destructor Documentation

◆ ActiveLineageScout()

concurrency::ActiveLineageScout::ActiveLineageScout ( const EventSlot slot,
const ControlFlowNode node 
)
inline

Constructor.

Definition at line 55 of file Validators.h.

56  : m_slot( slot ), m_startNode( node ), m_previousNodeName( node.name() ) {}

Member Function Documentation

◆ reply()

virtual bool concurrency::ActiveLineageScout::reply ( ) const
inlinevirtual

Reimplemented in concurrency::SubSlotScout.

Definition at line 72 of file Validators.h.

72 { return m_active; }

◆ reset()

void concurrency::ActiveLineageScout::reset ( )
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Reimplemented in concurrency::SubSlotScout.

Definition at line 67 of file Validators.h.

67  {
68  m_active = true;
70  }

◆ visit() [1/5]

virtual bool concurrency::IGraphVisitor::visit
inline

Definition at line 29 of file IGraphVisitor.h.

29 { return true; }

◆ visit() [2/5]

virtual bool concurrency::IGraphVisitor::visit
inline

Definition at line 35 of file IGraphVisitor.h.

35 { return true; }

◆ visit() [3/5]

virtual bool concurrency::IGraphVisitor::visit
inline

Definition at line 32 of file IGraphVisitor.h.

32 { return true; }

◆ visit() [4/5]

virtual bool concurrency::IGraphVisitor::visit
inline

Definition at line 26 of file IGraphVisitor.h.

26 { return true; }

◆ visit() [5/5]

bool concurrency::ActiveLineageScout::visit ( DecisionNode node)
overridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 38 of file Validators.cpp.

38  {
39 
40  // Test if this node is already resolved
41  if ( m_slot->controlFlowState[node.getNodeIndex()] != -1 ) {
42  m_active = false;
43  return m_active;
44  }
45 
46  // Test if the node that sent this scout is out-of-sequence in this node
47  if ( !node.m_modeConcurrent ) {
48 
49  for ( auto& child : node.getDaughters() ) {
50 
51  if ( child->name() == m_previousNodeName ) break;
52 
53  if ( m_slot->controlFlowState[child->getNodeIndex()] == -1 ) {
54  m_active = false;
55  return m_active;
56  }
57  }
58  }
59 
60  this->visitParents( node );
61 
62  return this->reply();
63  }

◆ visitEnter() [1/7]

virtual bool concurrency::IGraphVisitor::visitEnter
inline

Definition at line 28 of file IGraphVisitor.h.

28 { return true; }

◆ visitEnter() [2/7]

bool concurrency::ActiveLineageScout::visitEnter ( AlgorithmNode ) const
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 61 of file Validators.h.

61 { return false; }

◆ visitEnter() [3/7]

virtual bool concurrency::IGraphVisitor::visitEnter
inline

Definition at line 34 of file IGraphVisitor.h.

34 { return true; }

◆ visitEnter() [4/7]

bool concurrency::ActiveLineageScout::visitEnter ( ConditionNode ) const
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 63 of file Validators.h.

63 { return false; }

◆ visitEnter() [5/7]

virtual bool concurrency::IGraphVisitor::visitEnter
inline

Definition at line 31 of file IGraphVisitor.h.

31 { return true; }

◆ visitEnter() [6/7]

bool concurrency::ActiveLineageScout::visitEnter ( DataNode ) const
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 62 of file Validators.h.

62 { return false; }

◆ visitEnter() [7/7]

virtual bool concurrency::IGraphVisitor::visitEnter
inline

Definition at line 25 of file IGraphVisitor.h.

25 { return true; }

◆ visitParents()

void concurrency::ActiveLineageScout::visitParents ( DecisionNode node)
virtual

Reimplemented in concurrency::SubSlotScout.

Definition at line 66 of file Validators.cpp.

66  {
67 
68  for ( auto& parent : node.m_parents ) {
69  m_active = true;
70  m_previousNodeName = node.name();
71  parent->accept( *this );
72 
73  // Any active parent means that this node is active
74  if ( this->reply() ) break;
75  }
76  }

Member Data Documentation

◆ m_active

bool concurrency::ActiveLineageScout::m_active { true }
protected

Definition at line 79 of file Validators.h.

◆ m_previousNodeName

std::string concurrency::ActiveLineageScout::m_previousNodeName
protected

Definition at line 80 of file Validators.h.

◆ m_slot

const EventSlot* concurrency::ActiveLineageScout::m_slot
protected

Definition at line 77 of file Validators.h.

◆ m_startNode

const ControlFlowNode& concurrency::ActiveLineageScout::m_startNode
protected

Definition at line 78 of file Validators.h.


The documentation for this class was generated from the following files:
concurrency::ActiveLineageScout::m_previousNodeName
std::string m_previousNodeName
Definition: Validators.h:80
concurrency::ControlFlowNode::name
const std::string & name() const
Get node name.
Definition: PrecedenceRulesGraph.h:429
concurrency::ActiveLineageScout::m_slot
const EventSlot * m_slot
Definition: Validators.h:77
concurrency::ActiveLineageScout::reply
virtual bool reply() const
Definition: Validators.h:72
concurrency::ActiveLineageScout::m_active
bool m_active
Definition: Validators.h:79
concurrency::ActiveLineageScout::visitParents
virtual void visitParents(DecisionNode &)
Definition: Validators.cpp:66
concurrency::ActiveLineageScout::m_startNode
const ControlFlowNode & m_startNode
Definition: Validators.h:78
EventSlot::controlFlowState
std::vector< int > controlFlowState
State of the control flow.
Definition: EventSlot.h:87