Salome HOME
Updated copyright comment
[samples/component.git] / src / DataStreamComponent / DataStreamComponent_Impl.hxx
1 // Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  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, or (at your option) any later version.
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  SuperVisionTest DataStreamComponent : example of component
24 //  File   : DataStreamComponent_Impl.hxx
25 //  Author : Jean Rahuel
26 //  Module : SuperVisionTest
27 //  $Header:
28 //
29 #ifndef _DATASTREAMINTERFACE_IMPL_HXX_
30 #define _DATASTREAMINTERFACE_IMPL_HXX_
31
32 #ifdef WIN32
33 # if defined DATASTREAMFACTORYENGINE_EXPORTS || defined DataStreamFactoryEngine_EXPORTS
34 #  define DATASTREAMFACTORYENGINE_EXPORT __declspec( dllexport )
35 # else
36 #  define DATASTREAMFACTORYENGINE_EXPORT __declspec( dllimport )
37 # endif
38 #else
39 # define DATASTREAMFACTORYENGINE_EXPORT
40 #endif
41
42 #include <SALOMEconfig.h>
43 #include CORBA_SERVER_HEADER(DataStreamComponent)
44 #include CORBA_SERVER_HEADER(SALOME_Component)
45 #include "SALOME_Component_i.hxx"
46
47 class DATASTREAMFACTORYENGINE_EXPORT DataStreamFactory_Impl :  public POA_DataStreamComponent::DataStreamFactory ,
48                                                                public Engines_Component_i {
49 public:
50   DataStreamFactory_Impl() ;
51   DataStreamFactory_Impl( CORBA::ORB_ptr orb,
52                           PortableServer::POA_ptr poa,
53                           PortableServer::ObjectId * contId, 
54                           const char *instanceName,
55                           const char *interfaceName, bool withRegistry);
56
57   virtual ~DataStreamFactory_Impl();
58
59   virtual char* getVersion();
60
61   virtual void Setxy( CORBA::Long x , CORBA::Long y ) ;
62
63   virtual void Getxy( CORBA::Long & x , CORBA::Long & y ) ;
64
65   virtual void Add( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
66   virtual void Sub( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
67   virtual void Mul( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
68   virtual void Div( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
69
70   virtual DataStreamComponent::DataStream_ptr NewDataStream() ;
71
72 private:
73
74   long _x ;
75   long _y ;
76
77 };
78
79 class DATASTREAMFACTORYENGINE_EXPORT DataStreamFactory_Impl_SSL : public DataStreamFactory_Impl
80 {
81 public:
82   DataStreamFactory_Impl_SSL( CORBA::ORB_ptr orb,
83                           PortableServer::POA_ptr poa,
84                           PortableServer::ObjectId * contId, 
85                           const char *instanceName,
86                           const char *interfaceName):DataStreamFactory_Impl(orb,poa,contId,instanceName,interfaceName,false) { }
87 };
88
89 class DATASTREAMFACTORYENGINE_EXPORT DataStreamFactory_Impl_No_SSL : public DataStreamFactory_Impl
90 {
91 public:
92   DataStreamFactory_Impl_No_SSL( CORBA::ORB_ptr orb,
93                           PortableServer::POA_ptr poa,
94                           PortableServer::ObjectId * contId, 
95                           const char *instanceName,
96                           const char *interfaceName):DataStreamFactory_Impl(orb,poa,contId,instanceName,interfaceName,true) { }
97 };
98
99 extern "C"
100   DATASTREAMFACTORYENGINE_EXPORT
101   PortableServer::ObjectId * DataStreamFactoryEngine_factory
102                                    ( CORBA::ORB_ptr orb ,
103                                      PortableServer::POA_ptr poa , 
104                                      PortableServer::ObjectId * contId ,
105                                      const char *instanceName ,
106                                      const char *interfaceName ) ;
107
108
109 class DATASTREAMFACTORYENGINE_EXPORT DataStream_Impl :  public POA_DataStreamComponent::DataStream ,
110                                                         public Engines_Component_i {
111 protected:
112   DataStream_Impl() ;
113   DataStream_Impl( CORBA::ORB_ptr orb ,
114                    PortableServer::POA_ptr poa ,
115                    PortableServer::ObjectId * contId , 
116                    const char *instanceName ,
117                    const char *interfaceName , 
118                    const char * graphName ,
119                    const char * nodeName, bool withRegistry );
120
121   virtual ~DataStream_Impl();
122
123   virtual char* getVersion();
124
125   virtual void StreamSetxy( CORBA::Long x , CORBA::Long y ) ;
126
127   virtual void StreamGetxy( CORBA::Long & x , CORBA::Long & y ) ;
128
129   virtual void StreamAdd( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
130   virtual void StreamSub( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
131   virtual void StreamMul( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
132   virtual void StreamDiv( CORBA::Long x , CORBA::Long y , CORBA::Long & z ) ;
133
134 private:
135
136   long _x ;
137   long _y ;
138
139 };
140
141 class DATASTREAMFACTORYENGINE_EXPORT DataStream_Impl_SSL :  public DataStream_Impl {
142 public:
143   DataStream_Impl_SSL( CORBA::ORB_ptr orb ,
144                    PortableServer::POA_ptr poa ,
145                    PortableServer::ObjectId * contId , 
146                    const char *instanceName ,
147                    const char *interfaceName , 
148                    const char * graphName ,
149                    const char * nodeName):DataStream_Impl(orb,poa,contId,instanceName,interfaceName,graphName,nodeName,false) { }
150 };
151
152 class DATASTREAMFACTORYENGINE_EXPORT DataStream_Impl_No_SSL :  public DataStream_Impl {
153 public:
154   DataStream_Impl_No_SSL( CORBA::ORB_ptr orb ,
155                    PortableServer::POA_ptr poa ,
156                    PortableServer::ObjectId * contId , 
157                    const char *instanceName ,
158                    const char *interfaceName , 
159                    const char * graphName ,
160                    const char * nodeName):DataStream_Impl(orb,poa,contId,instanceName,interfaceName,graphName,nodeName,true) { }
161 };
162
163 #endif