The Gaudi Framework  master (594c33fa)
concurrency::ConditionalLineageFinder Class Reference

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

Inheritance diagram for concurrency::ConditionalLineageFinder:
Collaboration diagram for concurrency::ConditionalLineageFinder:

Public Member Functions

bool visitEnter (DataNode &) const override
 
bool visitEnter (ConditionNode &) const override
 
bool visit (DecisionNode &) override
 
bool visit (AlgorithmNode &) override
 
bool positive () const
 
bool negative () const
 
void reset () override
 
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 visitEnter (AlgorithmNode &) const
 
virtual bool visit (DataNode &)
 
virtual bool visit (ConditionNode &)
 

Private Attributes

bool m_positive { false }
 
bool m_negative { false }
 

Detailed Description

Definition at line 107 of file Validators.h.

Member Function Documentation

◆ negative()

bool concurrency::ConditionalLineageFinder::negative ( ) const
inline

Definition at line 119 of file Validators.h.

119 { return m_negative; };

◆ positive()

bool concurrency::ConditionalLineageFinder::positive ( ) const
inline

Definition at line 118 of file Validators.h.

118 { return m_positive; };

◆ reset()

void concurrency::ConditionalLineageFinder::reset ( )
inlineoverridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 121 of file Validators.h.

121  {
122  m_positive = false;
123  m_negative = false;
124  };

◆ visit() [1/6]

virtual bool concurrency::IGraphVisitor::visit
inline

Definition at line 29 of file IGraphVisitor.h.

29 { return true; };

◆ visit() [2/6]

bool concurrency::ConditionalLineageFinder::visit ( AlgorithmNode node)
overridevirtual

Reimplemented from concurrency::IGraphVisitor.

Definition at line 132 of file Validators.cpp.

132  {
133 
134  for ( const auto& parent : node.getParentDecisionHubs() ) {
135  this->visit( *parent );
136  if ( this->positive() && this->negative() ) break;
137  }
138 
139  return true;
140  }

◆ visit() [3/6]

virtual bool concurrency::IGraphVisitor::visit
inline

Definition at line 35 of file IGraphVisitor.h.

35 { return true; };

◆ visit() [4/6]

virtual bool concurrency::IGraphVisitor::visit
inline

Definition at line 32 of file IGraphVisitor.h.

32 { return true; };

◆ visit() [5/6]

virtual bool concurrency::IGraphVisitor::visit
inline

Definition at line 26 of file IGraphVisitor.h.

26 { return true; };

◆ visit() [6/6]

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 104 of file Validators.cpp.

104  {
105 
106  auto propValidator = NodePropertiesValidator();
107  propValidator.visit( node );
108 
109  // check if the visitor found a conditional path
110  if ( node.m_modePromptDecision && propValidator.passed() ) {
111  m_positive = true;
112  return true;
113  }
114 
115  // check if the visitor found an unconditional path
116  if ( node.m_parents.empty() ) {
117  m_negative = true;
118  return true;
119  }
120 
121  for ( const auto& parent : node.m_parents ) {
122  this->visit( *parent );
123  // check if a node is on both conditional and unconditional branches
124  // and stop since further navigation won't change the conclusion
125  if ( this->positive() && this->negative() ) break;
126  }
127 
128  return true;
129  }

◆ visitEnter() [1/6]

virtual bool concurrency::IGraphVisitor::visitEnter
inline

Definition at line 28 of file IGraphVisitor.h.

28 { return true; };

◆ visitEnter() [2/6]

virtual bool concurrency::IGraphVisitor::visitEnter
inline

Definition at line 34 of file IGraphVisitor.h.

34 { return true; };

◆ visitEnter() [3/6]

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 113 of file Validators.h.

113 { return false; };

◆ visitEnter() [4/6]

virtual bool concurrency::IGraphVisitor::visitEnter
inline

Definition at line 31 of file IGraphVisitor.h.

31 { return true; };

◆ visitEnter() [5/6]

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

Reimplemented from concurrency::IGraphVisitor.

Definition at line 112 of file Validators.h.

112 { return false; };

◆ visitEnter() [6/6]

virtual bool concurrency::IGraphVisitor::visitEnter
inline

Definition at line 25 of file IGraphVisitor.h.

25 { return true; };

Member Data Documentation

◆ m_negative

bool concurrency::ConditionalLineageFinder::m_negative { false }
private

Definition at line 128 of file Validators.h.

◆ m_positive

bool concurrency::ConditionalLineageFinder::m_positive { false }
private

Definition at line 127 of file Validators.h.


The documentation for this class was generated from the following files:
concurrency::ConditionalLineageFinder::positive
bool positive() const
Definition: Validators.h:118
concurrency::ConditionalLineageFinder::visit
bool visit(DecisionNode &) override
Definition: Validators.cpp:104
concurrency::ConditionalLineageFinder::negative
bool negative() const
Definition: Validators.h:119
concurrency::ConditionalLineageFinder::m_positive
bool m_positive
Definition: Validators.h:127
concurrency::ConditionalLineageFinder::m_negative
bool m_negative
Definition: Validators.h:128