1 // Copyright (C) 2007-2014 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SuperVisionTest SyrComponent : example of component performing some mathinatical operations
24 // File : SyrComponent_Impl.hxx
25 // Author : Jean Rahuel, CEA
26 // Module : SuperVisionTest
29 #ifndef _SYRCOMPONENT_IMPL_HXX_
30 #define _SYRCOMPONENT_IMPL_HXX_
33 # if defined SYRCOMPONENTENGINE_EXPORTS || defined SyrComponentEngine_EXPORTS
34 # define SYRCOMPONENTENGINE_EXPORT __declspec( dllexport )
36 # define SYRCOMPONENTENGINE_EXPORT __declspec( dllimport )
39 # define SYRCOMPONENTENGINE_EXPORT
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"
48 class SYRCOMPONENTENGINE_EXPORT SyrComponent_Impl : public POA_SuperVisionTest::SyrComponent,
49 public Engines_Component_i {
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 = true ) ;
59 virtual ~SyrComponent_Impl();
61 virtual char* getVersion();
63 virtual CORBA::Long C_ISEVEN( CORBA::Long anInteger ) ;
65 virtual CORBA::Long C_ISONE( CORBA::Long anOddInteger ) ;
67 virtual CORBA::Long C_M3( CORBA::Long anOddInteger ) ;
69 virtual CORBA::Long C_M3P1( CORBA::Long anOddInteger ) ;
71 virtual CORBA::Long C_DIV2( CORBA::Long anEvenInteger ) ;
73 virtual CORBA::Long C_INCR( CORBA::Long aCount ) ;
75 virtual void CPP_SETLONG( CORBA::Long aLong ) ;
77 virtual CORBA::Long CPP_ADDTOLONG( CORBA::Long anIncr ) ;
79 virtual CORBA::Long C_MIN( CORBA::Long aMinVal , CORBA::Long anInteger ) ;
81 virtual CORBA::Long C_MAX( CORBA::Long aMaxVal , CORBA::Long anInteger ) ;
83 virtual SuperVisionTest::ListOfSyr_ptr C_LISTOFSYR() ;
85 virtual SuperVisionTest::ListOfSyr_ptr C_AVERAGE(
86 SuperVisionTest::ListOfSyr_ptr aListOfSyr ,
87 CORBA::Long anInteger ,
89 CORBA::Double & anAverage ) ;
91 virtual SuperVisionTest::Syr_ptr Init( CORBA::Long anOddInteger ) ;
98 class SYRCOMPONENTENGINE_EXPORT ListOfSyr_Impl : public POA_SuperVisionTest::ListOfSyr ,
99 public Engines_Component_i {
101 ListOfSyr_Impl( CORBA::ORB_ptr orb ,
102 PortableServer::POA_ptr poa ,
103 PortableServer::ObjectId * contId ,
104 const char *instanceName ,
105 const char *interfaceName ,
106 const char * graphName ,
107 const char * nodeName ) ;
109 virtual ~ListOfSyr_Impl();
111 virtual char* getVersion();
113 virtual SuperVisionTest::SeqOfSyr * GetSeqOfSyr() ;
115 virtual void SetSeqOfSyr( const SuperVisionTest::SeqOfSyr & ) ;
118 SuperVisionTest::SeqOfSyr _SeqOfSyr ;
123 SYRCOMPONENTENGINE_EXPORT
124 PortableServer::ObjectId * SyrComponentEngine_factory
125 ( CORBA::ORB_ptr orb ,
126 PortableServer::POA_ptr poa ,
127 PortableServer::ObjectId * contId ,
128 const char *instanceName ,
129 const char *interfaceName ) ;
131 class SYRCOMPONENTENGINE_EXPORT Syr_Impl : public POA_SuperVisionTest::SyrComponent ,
132 public SyrComponent_Impl {
135 Syr_Impl( CORBA::ORB_ptr orb ,
136 PortableServer::POA_ptr poa ,
137 PortableServer::ObjectId * contId ,
138 const char *instanceName ,
139 const char *interfaceName ,
140 const char * graphName ,
141 const char * nodeName ,
142 const CORBA::Long anOddInteger );
146 virtual CORBA::Long Initial() ;
148 virtual CORBA::Long Current() ;
150 virtual CORBA::Long IsEven() ;
152 virtual CORBA::Long IsOne() ;
154 virtual CORBA::Long Count() ;
156 virtual void M3p1() ;
158 virtual void Div2() ;
160 virtual void Incr() ;
164 long _InitialInteger ;
165 long _CurrentInteger ;