Salome HOME
7e76995d6b0a29c08da3fa4992b97cfd1d46c07a
[samples/component.git] / src / SyrComponent / SyrComponent_Impl.hxx
1 //  SuperVisionTest SyrComponent : example of component performing some mathinatical operations
2 //
3 //  Copyright (C) 2003  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
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 CORBA::Long C_ISEVEN( CORBA::Long anInteger ) ;
52
53   virtual CORBA::Long C_ISONE( CORBA::Long anOddInteger ) ;
54
55   virtual CORBA::Long C_M3( CORBA::Long anOddInteger ) ;
56
57   virtual CORBA::Long C_M3P1( CORBA::Long anOddInteger ) ;
58
59   virtual CORBA::Long C_DIV2( CORBA::Long anEvenInteger ) ;
60
61   virtual CORBA::Long C_INCR( CORBA::Long aCount ) ;
62
63   virtual void CPP_SETLONG( CORBA::Long aLong ) ;
64
65   virtual CORBA::Long CPP_ADDTOLONG( CORBA::Long anIncr ) ;
66
67   virtual CORBA::Long C_MIN( CORBA::Long aMinVal , CORBA::Long anInteger ) ;
68
69   virtual CORBA::Long C_MAX( CORBA::Long aMaxVal , CORBA::Long anInteger ) ;
70
71   virtual SuperVisionTest::ListOfSyr_ptr C_LISTOFSYR() ;
72
73   virtual SuperVisionTest::ListOfSyr_ptr C_AVERAGE(
74                        SuperVisionTest::ListOfSyr_ptr aListOfSyr ,
75                        CORBA::Long anInteger ,
76                        CORBA::Long aCount ,
77                        CORBA::Double & anAverage ) ;
78
79   virtual SuperVisionTest::Syr_ptr Init( CORBA::Long anOddInteger ) ;
80
81 private:
82
83   long _Count ;
84 };
85
86 class ListOfSyr_Impl :  public POA_SuperVisionTest::ListOfSyr ,
87                         public Engines_Component_i {
88 public:
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 ) ;
96   ListOfSyr_Impl() ;
97   virtual ~ListOfSyr_Impl();
98
99   virtual SuperVisionTest::SeqOfSyr * GetSeqOfSyr() ;
100
101   virtual void SetSeqOfSyr( const SuperVisionTest::SeqOfSyr & ) ;
102
103 private:
104   SuperVisionTest::SeqOfSyr _SeqOfSyr ;
105
106 };
107
108 extern "C"
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 ) ;
115
116 class Syr_Impl :  public POA_SuperVisionTest::Syr ,
117                   public SyrComponent_Impl {
118 public:
119   Syr_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 CORBA::Long anOddInteger );
128
129   virtual ~Syr_Impl();
130
131   virtual CORBA::Long Initial() ;
132
133   virtual CORBA::Long Current() ;
134
135   virtual CORBA::Long IsEven() ;
136
137   virtual CORBA::Long IsOne() ;
138
139   virtual CORBA::Long Count() ;
140
141   virtual void M3p1() ;
142
143   virtual void Div2() ;
144
145   virtual void Incr() ;
146
147 private:
148
149   long _InitialInteger ;
150   long _CurrentInteger ;
151   long _Count ;
152
153 };
154
155 #endif