1 // Copyright (C) 2007-2013 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.
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_
32 //#include <iostream.h>
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(SyrComponent)
35 #include CORBA_SERVER_HEADER(SALOME_Component)
36 #include "SALOME_Component_i.hxx"
38 class SyrComponent_Impl : public POA_SuperVisionTest::SyrComponent ,
39 public Engines_Component_i {
42 SyrComponent_Impl( CORBA::ORB_ptr orb ,
43 PortableServer::POA_ptr poa ,
44 PortableServer::ObjectId * contId ,
45 const char *instanceName ,
46 const char *interfaceName ,
47 const bool kactivate = true ) ;
49 virtual ~SyrComponent_Impl();
51 virtual char* getVersion();
53 virtual CORBA::Long C_ISEVEN( CORBA::Long anInteger ) ;
55 virtual CORBA::Long C_ISONE( CORBA::Long anOddInteger ) ;
57 virtual CORBA::Long C_M3( CORBA::Long anOddInteger ) ;
59 virtual CORBA::Long C_M3P1( CORBA::Long anOddInteger ) ;
61 virtual CORBA::Long C_DIV2( CORBA::Long anEvenInteger ) ;
63 virtual CORBA::Long C_INCR( CORBA::Long aCount ) ;
65 virtual void CPP_SETLONG( CORBA::Long aLong ) ;
67 virtual CORBA::Long CPP_ADDTOLONG( CORBA::Long anIncr ) ;
69 virtual CORBA::Long C_MIN( CORBA::Long aMinVal , CORBA::Long anInteger ) ;
71 virtual CORBA::Long C_MAX( CORBA::Long aMaxVal , CORBA::Long anInteger ) ;
73 virtual SuperVisionTest::ListOfSyr_ptr C_LISTOFSYR() ;
75 virtual SuperVisionTest::ListOfSyr_ptr C_AVERAGE(
76 SuperVisionTest::ListOfSyr_ptr aListOfSyr ,
77 CORBA::Long anInteger ,
79 CORBA::Double & anAverage ) ;
81 virtual SuperVisionTest::Syr_ptr Init( CORBA::Long anOddInteger ) ;
88 class ListOfSyr_Impl : public POA_SuperVisionTest::ListOfSyr ,
89 public Engines_Component_i {
91 ListOfSyr_Impl( CORBA::ORB_ptr orb ,
92 PortableServer::POA_ptr poa ,
93 PortableServer::ObjectId * contId ,
94 const char *instanceName ,
95 const char *interfaceName ,
96 const char * graphName ,
97 const char * nodeName ) ;
99 virtual ~ListOfSyr_Impl();
101 virtual char* getVersion();
103 virtual SuperVisionTest::SeqOfSyr * GetSeqOfSyr() ;
105 virtual void SetSeqOfSyr( const SuperVisionTest::SeqOfSyr & ) ;
108 SuperVisionTest::SeqOfSyr _SeqOfSyr ;
113 PortableServer::ObjectId * SyrComponentEngine_factory
114 ( CORBA::ORB_ptr orb ,
115 PortableServer::POA_ptr poa ,
116 PortableServer::ObjectId * contId ,
117 const char *instanceName ,
118 const char *interfaceName ) ;
120 class Syr_Impl : public POA_SuperVisionTest::Syr ,
121 public SyrComponent_Impl {
124 Syr_Impl( CORBA::ORB_ptr orb ,
125 PortableServer::POA_ptr poa ,
126 PortableServer::ObjectId * contId ,
127 const char *instanceName ,
128 const char *interfaceName ,
129 const char * graphName ,
130 const char * nodeName ,
131 const CORBA::Long anOddInteger );
135 virtual CORBA::Long Initial() ;
137 virtual CORBA::Long Current() ;
139 virtual CORBA::Long IsEven() ;
141 virtual CORBA::Long IsOne() ;
143 virtual CORBA::Long Count() ;
145 virtual void M3p1() ;
147 virtual void Div2() ;
149 virtual void Incr() ;
153 long _InitialInteger ;
154 long _CurrentInteger ;