1 #ifndef __COMPOSEDNODE_HXX__
2 #define __COMPOSEDNODE_HXX__
5 #include "Scheduler.hxx"
16 class ComposedNode : public Node, public Scheduler
19 friend class ElementaryNode;
21 ComposedNode(const std::string& name);
23 void notifyFrom(const Task *sender, YACS::Event event);
24 bool edAddLink(OutputPort *start, InputPort *end) throw(Exception);
25 bool edAddLink(OutGate *start, InGate *end) throw(Exception);
26 bool edAddCFLink(Node *nodeS, Node *nodeE) throw(Exception);
27 void edRemoveLink(OutputPort *start, InputPort *end) throw(Exception);
28 void edRemoveLink(OutGate *start, InGate *end) throw(Exception);
29 virtual void publishOutputPort(OutputPort *port) throw(Exception);
30 virtual bool isRepeatedUnpredictablySeveralTimes() const { return false; }
32 ComposedNode *getRootNode() throw(Exception);
33 void disconnectAllLinksConnectedTo(Node *node);
34 virtual void publishInputPort(InputPort *port);
35 YACS::Event updateStateFrom(Node *node, YACS::Event event);//update the state of this. Precondition : node->_father == this
36 virtual YACS::Event updateStateOnStartEventFrom(Node *node) = 0;//transition 3 doc P.R
37 virtual YACS::Event updateStateOnFinishedEventFrom(Node *node) = 0;//transition 9 doc P.R.
38 virtual InPort *buildDelegateOf(InPort *port, const std::list<ComposedNode *>& pointsOfView);
39 virtual OutPort *buildDelegateOf(OutPort *port, const std::list<ComposedNode *>& pointsOfView);
40 virtual InPort *getDelegateOf(InPort *port, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
41 virtual OutPort *getDelegateOf(OutPort *port, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
42 virtual InPort *releaseDelegateOf(InPort *port, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
43 virtual OutPort *releaseDelegateOf(OutPort *port, const std::list<ComposedNode *>& pointsOfView) throw(Exception);
44 virtual void checkNoCyclePassingThrough(Node *node) throw(Exception) = 0;
45 void checkInMyDescendance(Node *nodeToTest) const throw(Exception);
46 static ComposedNode *getLowestCommonAncestor(Node *node1, Node *node2) throw(Exception);