Salome HOME
Updated copyright comment
[samples/component.git] / src / SyrComponent / SyrComponent_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 SyrComponent : example of component performing some mathinatical operations
24 //  File   : SyrComponent_Impl.hxx
25 //  Author : Jean Rahuel, CEA
26 //  Module : SuperVisionTest
27 //  $Header:
28 //
29 #ifndef _SYRCOMPONENT_IMPL_HXX_
30 #define _SYRCOMPONENT_IMPL_HXX_
31
32 #ifdef WIN32
33 # if defined SYRCOMPONENTENGINE_EXPORTS || defined SyrComponentEngine_EXPORTS                                                   
34 #  define SYRCOMPONENTENGINE_EXPORT __declspec( dllexport )
35 # else
36 #  define SYRCOMPONENTENGINE_EXPORT __declspec( dllimport )
37 # endif
38 #else
39 # define SYRCOMPONENTENGINE_EXPORT
40 #endif
41
42 //#include <iostream.h>
43 #include <SALOMEconfig.h>
44 #include CORBA_SERVER_HEADER(SyrComponent)
45 #include CORBA_SERVER_HEADER(SALOME_Component)
46 #include "SALOME_Component_i.hxx"
47
48 class SYRCOMPONENTENGINE_EXPORT SyrComponent_Impl : public POA_SuperVisionTest::SyrComponent,
49                                                       public Engines_Component_i {
50 public:
51   SyrComponent_Impl() ;
52   SyrComponent_Impl( CORBA::ORB_ptr orb ,
53                      PortableServer::POA_ptr poa ,
54                      PortableServer::ObjectId * contId , 
55                      const char *instanceName ,
56                      const char *interfaceName ,
57                      const bool kactivate, bool withRegistry ) ;
58
59   virtual ~SyrComponent_Impl();
60
61   virtual char* getVersion();
62
63   virtual CORBA::Long C_ISEVEN( CORBA::Long anInteger ) ;
64
65   virtual CORBA::Long C_ISONE( CORBA::Long anOddInteger ) ;
66
67   virtual CORBA::Long C_M3( CORBA::Long anOddInteger ) ;
68
69   virtual CORBA::Long C_M3P1( CORBA::Long anOddInteger ) ;
70
71   virtual CORBA::Long C_DIV2( CORBA::Long anEvenInteger ) ;
72
73   virtual CORBA::Long C_INCR( CORBA::Long aCount ) ;
74
75   virtual void CPP_SETLONG( CORBA::Long aLong ) ;
76
77   virtual CORBA::Long CPP_ADDTOLONG( CORBA::Long anIncr ) ;
78
79   virtual CORBA::Long C_MIN( CORBA::Long aMinVal , CORBA::Long anInteger ) ;
80
81   virtual CORBA::Long C_MAX( CORBA::Long aMaxVal , CORBA::Long anInteger ) ;
82
83   virtual SuperVisionTest::ListOfSyr_ptr C_LISTOFSYR() ;
84
85   virtual SuperVisionTest::ListOfSyr_ptr C_AVERAGE(
86                        SuperVisionTest::ListOfSyr_ptr aListOfSyr ,
87                        CORBA::Long anInteger ,
88                        CORBA::Long aCount ,
89                        CORBA::Double & anAverage ) ;
90
91   virtual SuperVisionTest::Syr_ptr Init( CORBA::Long anOddInteger ) ;
92
93 private:
94
95   long _Count ;
96 };
97
98 class SYRCOMPONENTENGINE_EXPORT SyrComponent_Impl_No_SSL : public SyrComponent_Impl
99 {
100 public:
101   SyrComponent_Impl_No_SSL() { }
102   SyrComponent_Impl_No_SSL( CORBA::ORB_ptr orb ,
103                      PortableServer::POA_ptr poa ,
104                      PortableServer::ObjectId * contId , 
105                      const char *instanceName , const char *interfaceName , const bool kactivate = true ):SyrComponent_Impl(orb,poa,contId,instanceName,interfaceName,kactivate,true) { }
106 };
107
108 class SYRCOMPONENTENGINE_EXPORT SyrComponent_Impl_SSL : public SyrComponent_Impl
109 {
110 public:
111   SyrComponent_Impl_SSL() { }
112   SyrComponent_Impl_SSL( CORBA::ORB_ptr orb ,
113                      PortableServer::POA_ptr poa ,
114                      PortableServer::ObjectId * contId , 
115                      const char *instanceName , const char *interfaceName , const bool kactivate = true ):SyrComponent_Impl(orb,poa,contId,instanceName,interfaceName,kactivate,false) { }
116 };
117
118 class SYRCOMPONENTENGINE_EXPORT ListOfSyr_Impl :  public POA_SuperVisionTest::ListOfSyr ,
119                                                    public Engines_Component_i {
120 protected:
121   ListOfSyr_Impl( CORBA::ORB_ptr orb ,
122                   PortableServer::POA_ptr poa ,
123                   PortableServer::ObjectId * contId , 
124                   const char *instanceName ,
125                   const char *interfaceName , 
126                   const char * graphName ,
127                   const char * nodeName, bool withRegistry ) ;
128   ListOfSyr_Impl() ;
129 public:
130   virtual ~ListOfSyr_Impl();
131
132   virtual char* getVersion();
133
134   virtual SuperVisionTest::SeqOfSyr * GetSeqOfSyr() ;
135
136   virtual void SetSeqOfSyr( const SuperVisionTest::SeqOfSyr & ) ;
137
138 private:
139   SuperVisionTest::SeqOfSyr _SeqOfSyr ;
140
141 };
142
143 class SYRCOMPONENTENGINE_EXPORT ListOfSyr_Impl_SSL : public ListOfSyr_Impl
144 {
145 public:
146   ListOfSyr_Impl_SSL( CORBA::ORB_ptr orb ,
147                   PortableServer::POA_ptr poa ,
148                   PortableServer::ObjectId * contId , 
149                   const char *instanceName ,
150                   const char *interfaceName , 
151                   const char * graphName ,
152                   const char * nodeName):ListOfSyr_Impl(orb,poa,contId,instanceName,interfaceName,graphName,nodeName,false) { }
153 };
154
155 class SYRCOMPONENTENGINE_EXPORT ListOfSyr_Impl_No_SSL : public ListOfSyr_Impl
156 {
157 public:
158   ListOfSyr_Impl_No_SSL( CORBA::ORB_ptr orb ,
159                   PortableServer::POA_ptr poa ,
160                   PortableServer::ObjectId * contId , 
161                   const char *instanceName ,
162                   const char *interfaceName , 
163                   const char * graphName ,
164                   const char * nodeName):ListOfSyr_Impl(orb,poa,contId,instanceName,interfaceName,graphName,nodeName,true) { }
165 };
166
167 extern "C"
168   SYRCOMPONENTENGINE_EXPORT
169   PortableServer::ObjectId * SyrComponentEngine_factory
170                                    ( CORBA::ORB_ptr orb ,
171                                      PortableServer::POA_ptr poa , 
172                                      PortableServer::ObjectId * contId ,
173                                      const char *instanceName ,
174                                      const char *interfaceName ) ;
175
176 class SYRCOMPONENTENGINE_EXPORT Syr_Impl :  public POA_SuperVisionTest::SyrComponent ,
177                                              public SyrComponent_Impl {
178 public:
179   Syr_Impl() ;
180   Syr_Impl( CORBA::ORB_ptr orb ,
181             PortableServer::POA_ptr poa ,
182             PortableServer::ObjectId * contId , 
183             const char *instanceName ,
184             const char *interfaceName , 
185             const char * graphName ,
186             const char * nodeName ,
187             const CORBA::Long anOddInteger, bool withRegistry);
188
189   virtual ~Syr_Impl();
190
191   virtual CORBA::Long Initial() ;
192
193   virtual CORBA::Long Current() ;
194
195   virtual CORBA::Long IsEven() ;
196
197   virtual CORBA::Long IsOne() ;
198
199   virtual CORBA::Long Count() ;
200
201   virtual void M3p1() ;
202
203   virtual void Div2() ;
204
205   virtual void Incr() ;
206
207 private:
208
209   long _InitialInteger ;
210   long _CurrentInteger ;
211   long _Count ;
212
213 };
214
215 class SYRCOMPONENTENGINE_EXPORT Syr_Impl_SSL :  public Syr_Impl
216 {
217 public:
218   Syr_Impl_SSL(CORBA::ORB_ptr orb ,
219             PortableServer::POA_ptr poa ,
220             PortableServer::ObjectId * contId , 
221             const char *instanceName ,
222             const char *interfaceName , 
223             const char * graphName ,
224             const char * nodeName ,
225             const CORBA::Long anOddInteger) : Syr_Impl(orb,poa,contId,instanceName,interfaceName,graphName,nodeName,anOddInteger,false) { }
226 };
227
228 class SYRCOMPONENTENGINE_EXPORT Syr_Impl_No_SSL :  public Syr_Impl
229 {
230 public:
231   Syr_Impl_No_SSL(CORBA::ORB_ptr orb ,
232             PortableServer::POA_ptr poa ,
233             PortableServer::ObjectId * contId , 
234             const char *instanceName ,
235             const char *interfaceName , 
236             const char * graphName ,
237             const char * nodeName ,
238             const CORBA::Long anOddInteger) : Syr_Impl(orb,poa,contId,instanceName,interfaceName,graphName,nodeName,anOddInteger,true) { }
239 };
240
241 #endif