Version: 9.15.0
YACS::ENGINE::InGate Class Reference

#include <InGate.hxx>

Inheritance diagram for YACS::ENGINE::InGate:
Collaboration diagram for YACS::ENGINE::InGate:

Public Member Functions

 InGate (Node *node)
 
virtual ~InGate ()
 
std::string getNameOfTypeOfCurrentInstance () const
 
void exNotifyFromPrecursor (OutGate *fromgate)
 Notify this port that an upstream node connected by a control flow link is finished. More...
 
std::list< std::pair< OutGate *, bool > > & edMapOutGate ()
 
void edAppendPrecursor (OutGate *fromgate)
 
void edRemovePrecursor (OutGate *fromgate)
 
int getNumberOfBackLinks () const
 
void edDisconnectAllLinksToMe ()
 
void exNotifyFailed ()
 Notify this port that an upstream node connected by a control flow link has failed. More...
 
void exNotifyDisabled ()
 Notify this port that an upstream node connected by a control flow link has been disabled. More...
 
void exReset ()
 
bool exIsReady () const
 
std::list< OutGate * > getBackLinks ()
 
void setPrecursorDone (OutGate *fromgate)
 
virtual std::string typeName ()
 
- Public Member Functions inherited from YACS::ENGINE::Port
virtual ~Port ()
 
NodegetNode () const
 
int getNumId () const
 
void modified ()
 

Static Protected Attributes

static const char NAME [] ="InGate"
 
- Static Protected Attributes inherited from YACS::ENGINE::Port
static int _total = 0
 
static const char NAME [] ="Port"
 

Private Attributes

std::list< std::pair< OutGate *, bool > > _backLinks
 

Friends

class Bloc
 
class Node
 

Additional Inherited Members

- Protected Member Functions inherited from YACS::ENGINE::Port
 Port (Node *node)
 
 Port (const Port &other, Node *newHelder)
 
- Protected Attributes inherited from YACS::ENGINE::Port
Node_node
 
int _id
 

Detailed Description

Definition at line 35 of file InGate.hxx.

Constructor & Destructor Documentation

◆ InGate()

InGate::InGate ( Node node)

Definition at line 33 of file InGate.cxx.

33  :Port(node)
34 {
35 }
Port(Node *node)
Definition: Port.cxx:34

◆ ~InGate()

InGate::~InGate ( )
virtual

Definition at line 37 of file InGate.cxx.

38 {
39 }

Member Function Documentation

◆ edAppendPrecursor()

void InGate::edAppendPrecursor ( OutGate fromgate)

Definition at line 99 of file InGate.cxx.

100 {
101  list< pair<OutGate *, bool> >::iterator iter(std::find_if(_backLinks.begin(),_backLinks.end(),ItemCmp(from)));
102  if(iter!=_backLinks.end())
103  (*iter).second=false;
104  else
105  _backLinks.push_back(pair<OutGate *, bool>(from,false));
106 }
std::list< std::pair< OutGate *, bool > > _backLinks
Definition: InGate.hxx:42

References _backLinks.

Referenced by YACS::ENGINE::OutGate::edAddInGate().

◆ edDisconnectAllLinksToMe()

void InGate::edDisconnectAllLinksToMe ( )

Definition at line 46 of file InGate.cxx.

47 {
48  for(list< std::pair<OutGate *, bool> >::iterator iter=_backLinks.begin();iter!=_backLinks.end();iter++)
49  ((*iter).first)->edRemoveInGate(this,false);
50  _backLinks.clear();
51 }

References _backLinks.

Referenced by YACS::ENGINE::Node::edDisconnectAllLinksWithMe().

◆ edMapOutGate()

std::list< std::pair<OutGate *, bool> >& YACS::ENGINE::InGate::edMapOutGate ( )
inline

Definition at line 48 of file InGate.hxx.

48 { return _backLinks; }

Referenced by YACS::ENGINE::CFDirectionVisTraits< false >::getNexts().

◆ edRemovePrecursor()

void InGate::edRemovePrecursor ( OutGate fromgate)

Definition at line 108 of file InGate.cxx.

109 {
110  list< pair<OutGate *, bool> >::iterator iter(std::find_if(_backLinks.begin(),_backLinks.end(),ItemCmp(from)));
111  if(iter!=_backLinks.end())
112  _backLinks.erase(iter);
113 }

References _backLinks.

Referenced by YACS::ENGINE::OutGate::edRemoveInGate(), and YACS::ENGINE::OutGate::edRemoveInGateOneWay().

◆ exIsReady()

bool InGate::exIsReady ( ) const

◆ exNotifyDisabled()

void InGate::exNotifyDisabled ( )

Notify this port that an upstream node connected by a control flow link has been disabled.

Definition at line 93 of file InGate.cxx.

94 {
95  if(_node)
97 }
virtual void exDisabledState()
Notify this node that it has been disabled.
Definition: Node.cxx:232
Node * _node
Definition: Port.hxx:55

References YACS::ENGINE::Port::_node, and YACS::ENGINE::Node::exDisabledState().

◆ exNotifyFailed()

void InGate::exNotifyFailed ( )

Notify this port that an upstream node connected by a control flow link has failed.

Definition at line 83 of file InGate.cxx.

84 {
85  if(_node)
87 }
virtual void exFailedState()
Notify this node that its execution has failed.
Definition: Node.cxx:219

References YACS::ENGINE::Port::_node, and YACS::ENGINE::Node::exFailedState().

◆ exNotifyFromPrecursor()

void InGate::exNotifyFromPrecursor ( OutGate from)

Notify this port that an upstream node connected by a control flow link is finished.

Calls the node's gate method : Node::exUpdateState

Called by OutGate::exNotifyDone

Definition at line 68 of file InGate.cxx.

69 {
70  DEBTRACE("InGate::exNotifyFromPrecursor");
71  list< pair<OutGate *, bool> >::iterator iter(std::find_if(_backLinks.begin(),_backLinks.end(),ItemCmp(from)));
72  if(iter==_backLinks.end())
73  throw YACS::Exception("InGate::exNotifyFromPrecursor : precursor not found !");
74  (*iter).second=true;
75  if(exIsReady())
77 }
#define DEBTRACE(msg)
Definition: YacsTrace.hxx:31
bool exIsReady() const
Definition: InGate.cxx:126
virtual void exUpdateState()
Update the node state.
Definition: Node.cxx:206

References _backLinks, YACS::ENGINE::Port::_node, DEBTRACE, exIsReady(), and YACS::ENGINE::Node::exUpdateState().

Referenced by YACS::ENGINE::ElementaryNode::getReadyTasks().

◆ exReset()

void InGate::exReset ( )

Definition at line 120 of file InGate.cxx.

121 {
122  for(list< std::pair<OutGate *, bool> >::iterator iter=_backLinks.begin();iter!=_backLinks.end();iter++)
123  (*iter).second=false;
124 }

References _backLinks.

Referenced by YACS::ENGINE::Node::init(), and YACS::ENGINE::ElementaryNode::initCommonPartWithoutStateManagement().

◆ getBackLinks()

◆ getNameOfTypeOfCurrentInstance()

string InGate::getNameOfTypeOfCurrentInstance ( ) const
virtual

Reimplemented from YACS::ENGINE::Port.

Definition at line 41 of file InGate.cxx.

42 {
43  return NAME;
44 }
static const char NAME[]
Definition: InGate.hxx:40

References NAME.

◆ getNumberOfBackLinks()

int InGate::getNumberOfBackLinks ( ) const

Definition at line 115 of file InGate.cxx.

116 {
117  return _backLinks.size();
118 }

References _backLinks.

◆ setPrecursorDone()

void InGate::setPrecursorDone ( OutGate fromgate)

Definition at line 142 of file InGate.cxx.

143 {
144  list< std::pair<OutGate *, bool> >::iterator iter(std::find_if(_backLinks.begin(),_backLinks.end(),ItemCmp(from)));
145  if(iter!=_backLinks.end())
146  (*iter).second=true;
147  else
148  throw YACS::Exception("InGate::setPrecursorDone : precursor not found !");
149 }

References _backLinks.

Referenced by YACS::ENGINE::graphParser::onEnd(), and YACS::ENGINE::Node::resetState().

◆ typeName()

virtual std::string YACS::ENGINE::InGate::typeName ( )
inlinevirtual

Reimplemented from YACS::ENGINE::Port.

Definition at line 59 of file InGate.hxx.

59 {return "YACS__ENGINE__InGate";}

Friends And Related Function Documentation

◆ Bloc

friend class Bloc
friend

Definition at line 37 of file InGate.hxx.

◆ Node

friend class Node
friend

Definition at line 38 of file InGate.hxx.

Member Data Documentation

◆ _backLinks

std::list< std::pair<OutGate *, bool> > YACS::ENGINE::InGate::_backLinks
private

◆ NAME

const char InGate::NAME ="InGate"
staticprotected

Definition at line 40 of file InGate.hxx.

Referenced by getNameOfTypeOfCurrentInstance().


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