Salome HOME
edb8732f0844fd6695e3c0dd18da89834fa6c8dd
[modules/yacs.git] / src / engine / InPort.hxx
1 //  Copyright (C) 2006-2008  CEA/DEN, EDF R&D
2 //
3 //  This library is free software; you can redistribute it and/or
4 //  modify it under the terms of the GNU Lesser General Public
5 //  License as published by the Free Software Foundation; either
6 //  version 2.1 of the License.
7 //
8 //  This library is distributed in the hope that it will be useful,
9 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
10 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 //  Lesser General Public License for more details.
12 //
13 //  You should have received a copy of the GNU Lesser General Public
14 //  License along with this library; if not, write to the Free Software
15 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19 #ifndef __INPORT_HXX__
20 #define __INPORT_HXX__
21
22 #include "DataPort.hxx"
23
24 #include <set>
25
26 namespace YACS
27 {
28   namespace ENGINE
29   {
30     class Loop;
31     class OutPort;
32     class ProxyPort;
33     class OutputPort;
34     class DynParaLoop;
35     class ForEachLoop;
36     class SplitterNode;
37     class ComposedNode;
38     class OptimizerLoop;
39     class ElementaryNode;
40     class CollectorSwOutPort;
41     class OutputDataStreamPort;
42     class InterceptorInputPort;
43
44     class InPort : public virtual DataPort
45     {
46       friend class Loop;
47       friend class OutPort;
48       friend class ProxyPort;
49       friend class OutputPort;
50       friend class DynParaLoop;
51       friend class ForEachLoop;
52       friend class SplitterNode;
53       friend class ComposedNode;
54       friend class OptimizerLoop;
55       friend class ElementaryNode; //for removeAllLinksWithMe
56       friend class CollectorSwOutPort;
57       friend class OutputDataStreamPort;
58       friend class InterceptorInputPort;
59     public:
60       virtual InPort *getPublicRepresentant() { return this; }
61       virtual int edGetNumberOfLinks() const;
62       virtual std::set<OutPort *> edSetOutPort() const;
63       virtual ~InPort();
64       virtual std::string typeName() {return "YACS__ENGINE__InPort";}
65     protected:
66       InPort(const InPort& other, Node *newHelder);
67       InPort(const std::string& name, Node *node, TypeCode* type);
68       void edRemoveAllLinksLinkedWithMe() throw(Exception);
69       virtual void edNotifyReferencedBy(OutPort *fromPort);
70       virtual void edNotifyDereferencedBy(OutPort *fromPort);
71       virtual void getAllRepresentants(std::set<InPort *>& repr) const;
72     protected:
73       std::set<OutPort *> _backLinks;
74     };
75   }
76 }
77
78 #endif