Salome HOME
eddd4267c7fcf166b5770a5934e4d0f0c163cf4d
[modules/superv.git] / src / Supervision / Port_Impl.hxx
1 //  SUPERV Supervision : contains the implementation of interfaces of SuperVision described in SUPERV.idl
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
6 //  This library is free software; you can redistribute it and/or 
7 //  modify it under the terms of the GNU Lesser General Public 
8 //  License as published by the Free Software Foundation; either 
9 //  version 2.1 of the License. 
10 // 
11 //  This library is distributed in the hope that it will be useful, 
12 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
13 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
14 //  Lesser General Public License for more details. 
15 // 
16 //  You should have received a copy of the GNU Lesser General Public 
17 //  License along with this library; if not, write to the Free Software 
18 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : Port_Impl.hxx
25 //  Author : Jean Rahuel
26 //  Module : SUPERV
27 //  $Header: 
28
29 #ifndef _PORT_IMPL_HXX_
30 #define _PORT_IMPL_HXX_
31
32 #include <sstream>
33 #include <iostream>
34
35 #include "CORBA.h"
36
37 #include <SALOMEconfig.h>
38 #include "SALOME_Component_i.hxx"
39 #include "SALOME_LifeCycleCORBA.hxx"
40
41 #include "Value_Impl.hxx"
42 #include "Link_Impl.hxx"
43 #include "FNode_Impl.hxx"
44
45 #include "DataFlowEditor_DataFlow.hxx"
46
47 class Port_Impl : public Value_Impl ,
48                   public POA_SUPERV::Port {
49   private:
50
51     CORBA::ORB_ptr             _Orb ;
52     PortableServer::POA_ptr    _Poa ;
53     PortableServer::ObjectId * _ContId ;
54
55     GraphEditor::DataFlow * _DataFlowEditor ;
56     GraphEditor::InNode *   _DataFlowNode ;
57     GraphBase::Port *       _DataFlowPort ;
58     bool                    _InputPort ;
59
60   public:
61     Port_Impl();
62     Port_Impl( CORBA::ORB_ptr orb ,
63                PortableServer::POA_ptr poa ,
64                PortableServer::ObjectId * contId , 
65                const char *instanceName ,
66                const char *interfaceName ,
67                GraphEditor::DataFlow * DataFlowEditor ,
68                GraphEditor::InNode * DataFlowNode ,
69                GraphBase::Port * DataFlowPort ,
70                bool InputPort ,
71 //               const char *ParameterName ,
72                const CORBA::Any * anAny ) ;
73     Port_Impl( CORBA::ORB_ptr orb ,
74                PortableServer::POA_ptr poa ,
75                PortableServer::ObjectId * contId , 
76                const char *instanceName ,
77                const char *interfaceName ,
78                GraphEditor::DataFlow * DataFlowEditor ,
79                GraphEditor::InNode * DataFlowNode ,
80                GraphBase::Port * DataFlowPort ,
81                bool InputPort ) ;
82 //               const char *ParameterName ) ;
83     virtual ~Port_Impl() ;
84     virtual void destroy() ;
85
86     GraphEditor::DataFlow * DataFlowEditor() {
87                             return _DataFlowEditor ; } ;
88     GraphEditor::InNode * DataFlowNode() {
89                           return _DataFlowNode ; } ;
90     GraphBase::Port * DataFlowPort() {
91                       return _DataFlowPort ; } ;
92
93     virtual bool Input( const SUPERV::Value_ptr aValue ) ;
94     virtual bool Input( const CORBA::Any * anAny ) ;
95
96     virtual char * Name()  ;
97     virtual char * Type()  ;
98
99     virtual SUPERV::CNode_ptr Node()  ;
100
101     virtual SUPERV::Link_ptr Link()  ;
102     virtual SUPERV::ListOfLinks * Links()  ;
103
104     virtual bool IsInput()  ;
105     virtual bool IsLinked()  ;
106     virtual bool HasInput()  ;
107
108     virtual SUPERV::KindOfPort Kind()  ;
109     virtual void SetKind( SUPERV::KindOfPort ) ;
110
111     virtual bool IsParam()  ;
112     virtual bool IsGate()  ;
113     virtual bool IsInLine()  ;
114     virtual bool IsLoop()  ;
115     virtual bool IsSwitch()  ;
116     virtual bool IsEndSwitch()  ;
117     virtual bool IsDataStream()  ;
118
119     virtual SUPERV::GraphState State()  ;
120     virtual bool IsDone()  ;
121
122 } ;
123
124 #endif