4 #include "ComposedNode.hxx"
5 #include "ElementaryNode.hxx"
13 class DFToDSForLoop : public ElementaryNode
18 Loop *_loopArtificiallyBuiltMe;
20 DFToDSForLoop(Loop *loop, const std::string& name, YACS::DynType type);
21 void loopHasOneMoreRef() { _nbOfTimeUsed++; }
22 bool loopHasOneLessRef() { return --_nbOfTimeUsed==0; }
23 InputPort *getInputPort(const std::string& name) const throw(Exception);
24 OutputDataStreamPort *getOutputDataStreamPort(const std::string& name) const throw(Exception);
31 class DSToDFForLoop : public ElementaryNode
36 Loop *_loopArtificiallyBuiltMe;
38 DSToDFForLoop(Loop *loop, const std::string& name, YACS::StreamType type);
39 void loopHasOneMoreRef() { _nbOfTimeUsed++; }
40 bool loopHasOneLessRef() { return --_nbOfTimeUsed==0; }
41 OutputPort *getOutputPort(const std::string& name) const throw(Exception);
42 InputDataStreamPort *getInputDataStreamPort(const std::string& name) const throw(Exception);
49 class Loop : public ComposedNode
53 std::list<InputPort *> _listOfExtraInputPort;
54 std::list<DSToDFForLoop> _inputsTraducer;
55 std::list<DFToDSForLoop> _outputsTraducer;
57 Loop(const std::string& name);
59 void edSetNode(Node *node);
60 void edAddExtraInputPort(const std::string& inputPortName, YACS::DynType type) throw(Exception);
61 void edRemoveExtraInputPort(InputPort *inputPort);
62 bool isRepeatedUnpredictablySeveralTimes() const { return true; }
63 static YACS::StreamType MappingDF2DS(YACS::DynType type) throw(Exception);
64 static YACS::DynType MappingDS2DF(YACS::StreamType type) throw(Exception);
66 InPort *buildDelegateOf(InPort *port, const std::list<ComposedNode *>& pointsOfView);
67 OutPort *buildDelegateOf(OutPort *port, const std::list<ComposedNode *>& pointsOfView);
68 InPort *getDelegateOf(InPort *port, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
69 OutPort *getDelegateOf(OutPort *port, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
70 InPort *releaseDelegateOf(InPort *port, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
71 OutPort *releaseDelegateOf(OutPort *port, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
72 void checkNoCyclePassingThrough(Node *node) throw(Exception);
73 static bool isNecessaryToBuildSpecificDelegateDF2DS(const std::list<ComposedNode *>& pointsOfView);