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; }
31 virtual const std::string getInputPortName(const InputPort *) throw (Exception);
32 virtual const std::string getOutputPortName(const OutputPort *) throw (Exception);
34 ComposedNode *getRootNode() throw(Exception);
35 void disconnectAllLinksConnectedTo(Node *node);
36 virtual void publishInputPort(InputPort *port);
37 virtual void unpublishInputPort(InputPort *port);
38 YACS::Event updateStateFrom(Node *node, YACS::Event event);//update the state of this. Precondition : node->_father == this
39 virtual YACS::Event updateStateOnStartEventFrom(Node *node) = 0;//transition 3 doc P.R
40 virtual YACS::Event updateStateOnFinishedEventFrom(Node *node) = 0;//transition 9 doc P.R.
41 virtual InPort *buildDelegateOf(InPort *port, const std::set<ComposedNode *>& pointsOfView);
42 virtual OutPort *buildDelegateOf(OutPort *port, const std::set<ComposedNode *>& pointsOfView);
43 virtual InPort *getDelegateOf(InPort *port, const std::set<ComposedNode *>& pointsOfView) throw(Exception);
44 virtual OutPort *getDelegateOf(OutPort *port, const std::set<ComposedNode *>& pointsOfView) throw(Exception);
45 virtual InPort *releaseDelegateOf(InPort *port, const std::set<ComposedNode *>& pointsOfView) throw(Exception);
46 virtual OutPort *releaseDelegateOf(OutPort *port, const std::set<ComposedNode *>& pointsOfView) throw(Exception);
47 virtual void checkNoCyclePassingThrough(Node *node) throw(Exception) = 0;
48 void checkInMyDescendance(Node *nodeToTest) const throw(Exception);
49 static ComposedNode *getLowestCommonAncestor(Node *node1, Node *node2) throw(Exception);