1 // Copyright (C) 2007-2008 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
22 // SuperVisionTest SyrComponent : example of component performing some mathinatical operations
23 // File : SyrComponent_Impl.hxx
24 // Author : Jean Rahuel, CEA
25 // Module : SuperVisionTest
28 #ifndef _SYRCOMPONENT_IMPL_HXX_
29 #define _SYRCOMPONENT_IMPL_HXX_
31 //#include <iostream.h>
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(SyrComponent)
34 #include CORBA_SERVER_HEADER(SALOME_Component)
35 #include "SALOME_Component_i.hxx"
37 class SyrComponent_Impl : public POA_SuperVisionTest::SyrComponent ,
38 public Engines_Component_i {
41 SyrComponent_Impl( CORBA::ORB_ptr orb ,
42 PortableServer::POA_ptr poa ,
43 PortableServer::ObjectId * contId ,
44 const char *instanceName ,
45 const char *interfaceName ,
46 const bool kactivate = true ) ;
48 virtual ~SyrComponent_Impl();
50 virtual CORBA::Long C_ISEVEN( CORBA::Long anInteger ) ;
52 virtual CORBA::Long C_ISONE( CORBA::Long anOddInteger ) ;
54 virtual CORBA::Long C_M3( CORBA::Long anOddInteger ) ;
56 virtual CORBA::Long C_M3P1( CORBA::Long anOddInteger ) ;
58 virtual CORBA::Long C_DIV2( CORBA::Long anEvenInteger ) ;
60 virtual CORBA::Long C_INCR( CORBA::Long aCount ) ;
62 virtual void CPP_SETLONG( CORBA::Long aLong ) ;
64 virtual CORBA::Long CPP_ADDTOLONG( CORBA::Long anIncr ) ;
66 virtual CORBA::Long C_MIN( CORBA::Long aMinVal , CORBA::Long anInteger ) ;
68 virtual CORBA::Long C_MAX( CORBA::Long aMaxVal , CORBA::Long anInteger ) ;
70 virtual SuperVisionTest::ListOfSyr_ptr C_LISTOFSYR() ;
72 virtual SuperVisionTest::ListOfSyr_ptr C_AVERAGE(
73 SuperVisionTest::ListOfSyr_ptr aListOfSyr ,
74 CORBA::Long anInteger ,
76 CORBA::Double & anAverage ) ;
78 virtual SuperVisionTest::Syr_ptr Init( CORBA::Long anOddInteger ) ;
85 class ListOfSyr_Impl : public POA_SuperVisionTest::ListOfSyr ,
86 public Engines_Component_i {
88 ListOfSyr_Impl( CORBA::ORB_ptr orb ,
89 PortableServer::POA_ptr poa ,
90 PortableServer::ObjectId * contId ,
91 const char *instanceName ,
92 const char *interfaceName ,
93 const char * graphName ,
94 const char * nodeName ) ;
96 virtual ~ListOfSyr_Impl();
98 virtual SuperVisionTest::SeqOfSyr * GetSeqOfSyr() ;
100 virtual void SetSeqOfSyr( const SuperVisionTest::SeqOfSyr & ) ;
103 SuperVisionTest::SeqOfSyr _SeqOfSyr ;
108 PortableServer::ObjectId * SyrComponentEngine_factory
109 ( CORBA::ORB_ptr orb ,
110 PortableServer::POA_ptr poa ,
111 PortableServer::ObjectId * contId ,
112 const char *instanceName ,
113 const char *interfaceName ) ;
115 class Syr_Impl : public POA_SuperVisionTest::Syr ,
116 public SyrComponent_Impl {
119 Syr_Impl( CORBA::ORB_ptr orb ,
120 PortableServer::POA_ptr poa ,
121 PortableServer::ObjectId * contId ,
122 const char *instanceName ,
123 const char *interfaceName ,
124 const char * graphName ,
125 const char * nodeName ,
126 const CORBA::Long anOddInteger );
130 virtual CORBA::Long Initial() ;
132 virtual CORBA::Long Current() ;
134 virtual CORBA::Long IsEven() ;
136 virtual CORBA::Long IsOne() ;
138 virtual CORBA::Long Count() ;
140 virtual void M3p1() ;
142 virtual void Div2() ;
144 virtual void Incr() ;
148 long _InitialInteger ;
149 long _CurrentInteger ;