Salome HOME
059cb6b6edf3085dc73f3f6c6c809a45553d1f46
[modules/superv.git] / src / Supervision / Link_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   : Link_Impl.hxx
25 //  Author : Jean Rahuel
26 //  Module : SUPERV
27 //  $Header: 
28
29 #ifndef _LINK_IMPL_HXX_
30 #define _LINK_IMPL_HXX_
31
32 //#include <iostream.h>
33
34 #include "CORBA.h"
35
36 #include <SALOMEconfig.h>
37 #include "SALOME_Component_i.hxx"
38 #include "SALOME_LifeCycleCORBA.hxx"
39
40 #include "Value_Impl.hxx"
41 #include "Port_Impl.hxx"
42
43 #include "DataFlowEditor_DataFlow.hxx"
44
45 class Link_Impl : public POA_SUPERV::Link ,
46                   public Engines_Component_i  {
47   private:
48
49     CORBA::ORB_ptr _Orb ;
50     PortableServer::POA_ptr _Poa ;
51     PortableServer::ObjectId * _ContId ;
52
53     GraphEditor::DataFlow * _DataFlowEditor ;
54     GraphEditor::InNode *   _DataFlowNode ;
55     char *                  _DataFlowNodeName ;
56     char *                  _InputParameterName ;
57     GraphEditor::InNode *   _DataFlowOutNode ;
58     char *                  _DataFlowOutNodeName ;
59     char *                  _OutputParameterName ;
60
61   public:
62     Link_Impl();
63     Link_Impl( CORBA::ORB_ptr orb ,
64                PortableServer::POA_ptr poa ,
65                PortableServer::ObjectId * contId , 
66                const char *instanceName ,
67                const char *interfaceName ,
68                GraphEditor::DataFlow * DataFlowEditor ,
69                GraphEditor::InNode * DataFlowNode ,
70                const char *InputParameterName ,
71                GraphEditor::InNode * DataFlowOutNode ,
72                const char *OutputParameterName ,
73                const bool Create ,
74                const bool Get ,
75                bool & Success ) ;
76
77     virtual ~Link_Impl() ;
78     virtual void destroy() ;
79     virtual bool Delete() ;
80
81     GraphEditor::DataFlow * DataFlowEditor() {
82                             return _DataFlowEditor ; } ;
83     GraphEditor::InNode * DataFlowNode() {
84                           return _DataFlowNode ; } ;
85     char * DataFlowNodeName() {
86            return _DataFlowNodeName ; } ;
87     char * InputParameterName() {
88            return _InputParameterName ; } ;
89     GraphEditor::InNode * DataFlowOutNode() {
90                           return _DataFlowOutNode ; } ;
91     char * DataFlowOutNodeName() {
92            return _DataFlowOutNodeName ; } ;
93     char * OutputParameterName() {
94            return _OutputParameterName ; } ;
95
96     SUPERV::Port_ptr OutPort() ;
97     SUPERV::Port_ptr InPort() ;
98
99     virtual GraphBase::SLink * Info() ;
100
101     virtual long CoordsSize() ;
102     virtual bool AddCoord( const long index ,
103                            const long X ,
104                            const long Y ) ;
105     virtual bool ChangeCoord( const long index ,
106                               const long X ,
107                               const long Y ) ;
108     virtual bool RemoveCoord( const long index ) ;
109     virtual bool Coords( const long index , long & X , long & Y ) ;
110
111     virtual bool IsValid(); // returns true if inPort() and outPort() are type-compatible
112     
113     virtual bool IsEqual( SUPERV::Link_ptr theLink ); // returns true if GraphBase::InPort-s and OutPort-s of
114                                                       // this Link and theLink are equal 
115
116 } ;
117
118 #endif