4 using namespace YACS::ENGINE;
7 const char OutGate::NAME[]="OutGate";
9 OutGate::OutGate(Node *node):Port(node)
13 string OutGate::getNameOfTypeOfCurrentInstance() const
18 void OutGate::exNotifyDone()
20 for(set<InGate *>::iterator iter=_setOfInGate.begin();iter!=_setOfInGate.end();iter++)
21 (*iter)->exNotifyFromPrecursor();
24 bool OutGate::edAddInGate(InGate *inGate)
26 if(!isAlreadyInSet(inGate))
28 inGate->edAppendPrecursor();
29 _setOfInGate.insert(inGate);
36 set<InGate *> OutGate::edSetInGate() const
41 void OutGate::edRemoveInGate(InGate *inGate) throw(Exception)
44 for(set<InGate *>::iterator iter=_setOfInGate.begin();iter!=_setOfInGate.end() && !found;iter++)
47 _setOfInGate.erase(iter);
48 inGate->edRemovePrecursor();
52 throw Exception("InGate not already connected to OutGate");
55 //Idem OutGate::edRemoveInGateOneWay except that no exception thrown if CF not exists
56 void OutGate::edRemoveInGateOneWay(InGate *inGate)
59 for(set<InGate *>::iterator iter=_setOfInGate.begin();iter!=_setOfInGate.end() && !found;iter++)
62 _setOfInGate.erase(iter);
63 inGate->edRemovePrecursor();
68 bool OutGate::isAlreadyInSet(InGate *inGate) const
71 for(set<InGate *>::const_iterator iter=_setOfInGate.begin();iter!=_setOfInGate.end() && !ret;iter++)
77 int OutGate::getNbOfInGatesConnected() const
79 return _setOfInGate.size();