Version: 8.3.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 ( Node node)

Definition at line 33 of file InGate.cxx.

33  :Port(node)
34 {
35 }
InGate::~InGate ( )
virtual

Definition at line 37 of file InGate.cxx.

38 {
39 }

Member Function Documentation

void InGate::edAppendPrecursor ( OutGate fromgate)

Definition at line 99 of file InGate.cxx.

References _backLinks.

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

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 }
void InGate::edDisconnectAllLinksToMe ( )

Definition at line 46 of file InGate.cxx.

References _backLinks.

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

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 }
std::list< std::pair<OutGate *, bool> >& YACS::ENGINE::InGate::edMapOutGate ( )
inline

Definition at line 48 of file InGate.hxx.

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

48 { return _backLinks; }
void InGate::edRemovePrecursor ( OutGate fromgate)

Definition at line 108 of file InGate.cxx.

References _backLinks.

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

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 }
bool InGate::exIsReady ( ) const
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.

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

94 {
95  if(_node)
97 }
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.

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

84 {
85  if(_node)
87 }
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.

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

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

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 }
void InGate::exReset ( )

Definition at line 120 of file InGate.cxx.

References _backLinks.

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

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

Definition at line 134 of file InGate.cxx.

References _backLinks.

Referenced by YACS::ENGINE::ElementaryNode::getReadyTasks(), YACS::ENGINE::AbstractPoint::isBegin(), YACS::ENGINE::AbstractPoint::IsGatherB4Ext(), YACS::ENGINE::AbstractPoint::IsNoLinksBefore(), YACS::ENGINE::AbstractPoint::IsSimplyLinkedBeforeExt(), YACS::ENGINE::graphParser::onEnd(), YACS::ENGINE::Node::resetState(), and YACS::HMI::SubjectNode::saveLinks().

135 {
136  list<OutGate *> listo;
137  for(list< std::pair<OutGate *, bool> >::const_iterator iter=_backLinks.begin();iter!=_backLinks.end();iter++)
138  listo.push_back(iter->first);
139  return listo;
140 }
string InGate::getNameOfTypeOfCurrentInstance ( ) const
virtual

Reimplemented from YACS::ENGINE::Port.

Definition at line 41 of file InGate.cxx.

References NAME.

42 {
43  return NAME;
44 }
int InGate::getNumberOfBackLinks ( ) const

Definition at line 115 of file InGate.cxx.

References _backLinks.

116 {
117  return _backLinks.size();
118 }
void InGate::setPrecursorDone ( OutGate fromgate)

Definition at line 142 of file InGate.cxx.

References _backLinks.

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

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 }
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

friend class Bloc
friend

Definition at line 37 of file InGate.hxx.

friend class Node
friend

Definition at line 38 of file InGate.hxx.

Member Data Documentation

std::list< std::pair<OutGate *, bool> > YACS::ENGINE::InGate::_backLinks
private
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: