Salome HOME
merge from branch DEV tag mergeto_trunk_04apr08
[modules/yacs.git] / src / engine / InPort.hxx
1 #ifndef __INPORT_HXX__
2 #define __INPORT_HXX__
3
4 #include "DataPort.hxx"
5
6 #include <set>
7
8 namespace YACS
9 {
10   namespace ENGINE
11   {
12     class Loop;
13     class OutPort;
14     class ProxyPort;
15     class OutputPort;
16     class DynParaLoop;
17     class ForEachLoop;
18     class SplitterNode;
19     class ComposedNode;
20     class OptimizerLoop;
21     class ElementaryNode;
22     class CollectorSwOutPort;
23     class OutputDataStreamPort;
24     class InterceptorInputPort;
25
26     class InPort : public virtual DataPort
27     {
28       friend class Loop;
29       friend class OutPort;
30       friend class ProxyPort;
31       friend class OutputPort;
32       friend class DynParaLoop;
33       friend class ForEachLoop;
34       friend class SplitterNode;
35       friend class ComposedNode;
36       friend class OptimizerLoop;
37       friend class ElementaryNode; //for removeAllLinksWithMe
38       friend class CollectorSwOutPort;
39       friend class OutputDataStreamPort;
40       friend class InterceptorInputPort;
41     public:
42       virtual InPort *getPublicRepresentant() { return this; }
43       virtual int edGetNumberOfLinks() const;
44       virtual std::set<OutPort *> edSetOutPort() const;
45       virtual ~InPort();
46       virtual std::string typeName() {return "YACS__ENGINE__InPort";}
47     protected:
48       InPort(const InPort& other, Node *newHelder);
49       InPort(const std::string& name, Node *node, TypeCode* type);
50       void edRemoveAllLinksLinkedWithMe() throw(Exception);
51       virtual void edNotifyReferencedBy(OutPort *fromPort);
52       virtual void edNotifyDereferencedBy(OutPort *fromPort);
53       virtual void getAllRepresentants(std::set<InPort *>& repr) const;
54     protected:
55       std::set<OutPort *> _backLinks;
56     };
57   }
58 }
59
60 #endif