1 #include "OutputDataStreamPort.hxx"
2 #include "InputDataStreamPort.hxx"
3 //#include "TypeCheckerDataStream.hxx"
5 using namespace YACS::ENGINE;
8 const char OutputDataStreamPort::NAME[]="OutputDataStreamPort";
10 OutputDataStreamPort::OutputDataStreamPort(const string& name, Node *node, TypeCode* type):DataStreamPort(name,node,type),OutPort(node),Port(node)
14 string OutputDataStreamPort::getNameOfTypeOfCurrentInstance() const
19 bool OutputDataStreamPort::edAddInputDataStreamPort(InputDataStreamPort *port) throw(ConversionException)
21 // if(!TypeCheckerDataStream::areStaticallyCompatible(edGetType(),port->edGetType()))
22 // throw ConversionException(TypeCheckerDataStream::edGetTypeInPrintableForm(edGetType()),TypeCheckerDataStream::edGetTypeInPrintableForm(port-> throw ConversionException(TypeCheckerDataStream::edGetTypeInPrintableForm(edGetType()),TypeCheckerDataStream::edGetTypeInPrintableForm(port->edGetType()));
23 if(!isAlreadyInSet(port))
25 _setOfInputDataStreamPort.insert(port);
32 void OutputDataStreamPort::edRemoveInputDataStreamPort(InputDataStreamPort *inputPort) throw(Exception)
34 if(isAlreadyInSet(inputPort))
35 _setOfInputDataStreamPort.erase(inputPort);
37 // throw Exception("OutputDataStreamPort::edRemoveInputDataStreamPort : link does not exist, unable to remove it");
40 //Idem OutputDataStreamPort::edRemoveInputDataStreamPort but no exception thrown if inputPort is not known
41 void OutputDataStreamPort::edRemoveInputDataStreamPortOneWay(InputDataStreamPort *inputPort)
43 _setOfInputDataStreamPort.erase(inputPort);
46 bool OutputDataStreamPort::addInPort(InPort *inPort) throw(Exception)
50 void OutputDataStreamPort::removeInPort(InPort *inPort) throw(Exception)
54 bool OutputDataStreamPort::isLinked()
56 return _setOfInputDataStreamPort.empty();
59 bool OutputDataStreamPort::isAlreadyInSet(InputDataStreamPort *inputPort) const
62 for(set<InputDataStreamPort *>::const_iterator iter=_setOfInputDataStreamPort.begin();iter!=_setOfInputDataStreamPort.end();iter++)
63 if((*iter)==inputPort)