4 using namespace YACS::ENGINE;
7 const char InGate::NAME[]="InGate";
9 InGate::InGate(Node *node):Port(node)
17 string InGate::getNameOfTypeOfCurrentInstance() const
22 void InGate::edDisconnectAllLinksToMe()
24 for(map<OutGate *, bool >::iterator iter=_backLinks.begin();iter!=_backLinks.end();iter++)
25 ((*iter).first)->edRemoveInGate(this,false);
29 //! Notify this port that an upstream node connected by a control flow link is finished
31 * Calls the node's gate method : Node::exUpdateState
33 * Called by OutGate::exNotifyDone
35 void InGate::exNotifyFromPrecursor(OutGate *from)
37 map< OutGate *, bool >::iterator iter=_backLinks.find(from);
40 _node->exUpdateState();
43 //! Notify this port that an upstream node connected by a control flow link has failed
47 void InGate::exNotifyFailed()
49 if(_node) _node->exFailedState();
52 //! Notify this port that an upstream node connected by a control flow link has been disabled
56 void InGate::exNotifyDisabled()
59 _node->exDisabledState();
62 void InGate::edAppendPrecursor(OutGate *from)
64 _backLinks[from]=false;
67 void InGate::edRemovePrecursor(OutGate *from)
69 _backLinks.erase(from);
72 int InGate::getNumberOfBackLinks() const
74 return _backLinks.size();
77 void InGate::exReset()
79 for(map<OutGate *, bool >::iterator iter=_backLinks.begin();iter!=_backLinks.end();iter++)
83 bool InGate::exIsReady() const
86 for(map<OutGate *, bool >::const_iterator iter=_backLinks.begin();iter!=_backLinks.end() && isReady;iter++)
87 isReady=(*iter).second;
91 std::list<OutGate *> InGate::getBackLinks()
93 list<OutGate *> listo;
94 for(map<OutGate *, bool >::iterator iter=_backLinks.begin();iter!=_backLinks.end();iter++)
95 listo.push_back(iter->first);
99 void InGate::setPrecursorDone(OutGate *from)
101 map< OutGate *, bool >::iterator iter=_backLinks.find(from);