Salome HOME
Merge from V6_main 01/04/2013
[samples/component.git] / src / SyrComponent / SyrComponent_Impl.hxx
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, 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.
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 //#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"
37
38 class SyrComponent_Impl :  public POA_SuperVisionTest::SyrComponent ,
39                            public Engines_Component_i {
40 public:
41   SyrComponent_Impl() ;
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 ) ;
48
49   virtual ~SyrComponent_Impl();
50
51   virtual char* getVersion();
52
53   virtual CORBA::Long C_ISEVEN( CORBA::Long anInteger ) ;
54
55   virtual CORBA::Long C_ISONE( CORBA::Long anOddInteger ) ;
56
57   virtual CORBA::Long C_M3( CORBA::Long anOddInteger ) ;
58
59   virtual CORBA::Long C_M3P1( CORBA::Long anOddInteger ) ;
60
61   virtual CORBA::Long C_DIV2( CORBA::Long anEvenInteger ) ;
62
63   virtual CORBA::Long C_INCR( CORBA::Long aCount ) ;
64
65   virtual void CPP_SETLONG( CORBA::Long aLong ) ;
66
67   virtual CORBA::Long CPP_ADDTOLONG( CORBA::Long anIncr ) ;
68
69   virtual CORBA::Long C_MIN( CORBA::Long aMinVal , CORBA::Long anInteger ) ;
70
71   virtual CORBA::Long C_MAX( CORBA::Long aMaxVal , CORBA::Long anInteger ) ;
72
73   virtual SuperVisionTest::ListOfSyr_ptr C_LISTOFSYR() ;
74
75   virtual SuperVisionTest::ListOfSyr_ptr C_AVERAGE(
76                        SuperVisionTest::ListOfSyr_ptr aListOfSyr ,
77                        CORBA::Long anInteger ,
78                        CORBA::Long aCount ,
79                        CORBA::Double & anAverage ) ;
80
81   virtual SuperVisionTest::Syr_ptr Init( CORBA::Long anOddInteger ) ;
82
83 private:
84
85   long _Count ;
86 };
87
88 class ListOfSyr_Impl :  public POA_SuperVisionTest::ListOfSyr ,
89                         public Engines_Component_i {
90 public:
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 ) ;
98   ListOfSyr_Impl() ;
99   virtual ~ListOfSyr_Impl();
100
101   virtual char* getVersion();
102
103   virtual SuperVisionTest::SeqOfSyr * GetSeqOfSyr() ;
104
105   virtual void SetSeqOfSyr( const SuperVisionTest::SeqOfSyr & ) ;
106
107 private:
108   SuperVisionTest::SeqOfSyr _SeqOfSyr ;
109
110 };
111
112 extern "C"
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 ) ;
119
120 class Syr_Impl :  public POA_SuperVisionTest::Syr ,
121                   public SyrComponent_Impl {
122 public:
123   Syr_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 );
132
133   virtual ~Syr_Impl();
134
135   virtual CORBA::Long Initial() ;
136
137   virtual CORBA::Long Current() ;
138
139   virtual CORBA::Long IsEven() ;
140
141   virtual CORBA::Long IsOne() ;
142
143   virtual CORBA::Long Count() ;
144
145   virtual void M3p1() ;
146
147   virtual void Div2() ;
148
149   virtual void Incr() ;
150
151 private:
152
153   long _InitialInteger ;
154   long _CurrentInteger ;
155   long _Count ;
156
157 };
158
159 #endif