4 using namespace YACS::ENGINE;
7 const char OutGate::NAME[]="OutGate";
9 OutGate::OutGate(Node *node):Port(node)
13 std::string OutGate::getNameOfTypeOfCurrentInstance() const
18 void OutGate::exNotifyDone()
20 for(list<InGate *>::iterator iter=_listOfInGate.begin();iter!=_listOfInGate.end();iter++)
21 (*iter)->exNotifyFromPrecursor();
24 bool OutGate::edAddInGate(InGate *inGate)
26 if(!isAlreadyInList(inGate))
28 inGate->edAppendPrecursor();
29 _listOfInGate.push_back(inGate);
36 std::list<InGate *> OutGate::edListInGate() const
41 void OutGate::edRemoveInGate(InGate *inGate) throw(Exception)
44 for(list<InGate *>::iterator iter=_listOfInGate.begin();iter!=_listOfInGate.end() && !found;iter++)
47 _listOfInGate.erase(iter);
48 inGate->edRemovePrecursor();
52 throw Exception("InGate not already connected to OutGate");
55 bool OutGate::isAlreadyInList(InGate *inGate) const
58 for(list<InGate *>::const_iterator iter=_listOfInGate.begin();iter!=_listOfInGate.end() && !ret;iter++)
64 int OutGate::getNbOfInGatesConnected() const
66 return _listOfInGate.size();