1 // SuperVisionTest SyrComponent : example of component performing some mathinatical operations
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
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 long C_ISEVEN( const long anInteger ) ;
53 virtual long C_ISONE( const long anOddInteger ) ;
55 virtual long C_M3( const long anOddInteger ) ;
57 virtual long C_M3P1( const long anOddInteger ) ;
59 virtual long C_DIV2( const long anEvenInteger ) ;
61 virtual long C_INCR( const long aCount ) ;
63 virtual void CPP_SETLONG( const long aLong ) ;
65 virtual long CPP_ADDTOLONG( const long anIncr ) ;
67 virtual long C_MIN( const long aMinVal , const long anInteger ) ;
69 virtual long C_MAX( const long aMaxVal , const long anInteger ) ;
71 virtual SuperVisionTest::ListOfSyr_ptr C_LISTOFSYR() ;
73 virtual SuperVisionTest::ListOfSyr_ptr C_AVERAGE(
74 const SuperVisionTest::ListOfSyr_ptr aListOfSyr ,
75 const long anInteger ,
77 double & anAverage ) ;
79 virtual SuperVisionTest::Syr_ptr Init( const long anOddInteger ) ;
86 class ListOfSyr_Impl : public POA_SuperVisionTest::ListOfSyr ,
87 public Engines_Component_i {
89 ListOfSyr_Impl( CORBA::ORB_ptr orb ,
90 PortableServer::POA_ptr poa ,
91 PortableServer::ObjectId * contId ,
92 const char *instanceName ,
93 const char *interfaceName ,
94 const char * graphName ,
95 const char * nodeName ) ;
97 virtual ~ListOfSyr_Impl();
99 virtual SuperVisionTest::SeqOfSyr * GetSeqOfSyr() ;
101 virtual void SetSeqOfSyr( const SuperVisionTest::SeqOfSyr & ) ;
104 SuperVisionTest::SeqOfSyr _SeqOfSyr ;
109 PortableServer::ObjectId * SyrComponentEngine_factory
110 ( CORBA::ORB_ptr orb ,
111 PortableServer::POA_ptr poa ,
112 PortableServer::ObjectId * contId ,
113 const char *instanceName ,
114 const char *interfaceName ) ;
116 class Syr_Impl : public POA_SuperVisionTest::Syr ,
117 public SyrComponent_Impl {
120 Syr_Impl( CORBA::ORB_ptr orb ,
121 PortableServer::POA_ptr poa ,
122 PortableServer::ObjectId * contId ,
123 const char *instanceName ,
124 const char *interfaceName ,
125 const char * graphName ,
126 const char * nodeName ,
127 const long anOddInteger );
131 virtual long Initial() ;
133 virtual long Current() ;
135 virtual long IsEven() ;
137 virtual long IsOne() ;
139 virtual long Count() ;
141 virtual void M3p1() ;
143 virtual void Div2() ;
145 virtual void Incr() ;
149 long _InitialInteger ;
150 long _CurrentInteger ;