Salome HOME
Join modifications from branch V3_1_0_For_CCRT
[samples/component.git] / src / CalculatorComponent / CalculatorEngine.hxx
1 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
3 // 
4 //  This library is free software; you can redistribute it and/or 
5 //  modify it under the terms of the GNU Lesser General Public 
6 //  License as published by the Free Software Foundation; either 
7 //  version 2.1 of the License. 
8 // 
9 //  This library is distributed in the hope that it will be useful, 
10 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 //  Lesser General Public License for more details. 
13 // 
14 //  You should have received a copy of the GNU Lesser General Public 
15 //  License along with this library; if not, write to the Free Software 
16 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
17 // 
18 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
19 //
20 //
21 //
22 //  File   : CalculatorEngine.hxx
23 //  Author : Laurent DADA, CEA
24 //  Module : CalculatorComponent
25 //  $Header   :  Exp $
26
27 #ifndef _CALCULATORWRAPPER_HXX_
28 #define _CALCULATORWRAPPER_HXX_
29
30 // IDL headers
31 #include <string>
32 #include <SALOMEconfig.h>
33 #include CORBA_SERVER_HEADER(Calculator)
34 #include "SALOME_Component_i.hxx"
35 #include CORBA_CLIENT_HEADER(MED)
36 #include "MEDMEM_Med_i.hxx"
37 #include "MEDMEM_Field.hxx"
38 #include "MEDMEM_FieldTemplate_i.hxx"
39
40 #include "SALOME_NamingService.hxx"
41
42 class CalculatorEngine :  
43   virtual public POA_SuperVisionTest::Calculator,
44   public Engines_Component_i 
45 {
46
47 public:
48   CalculatorEngine() ;
49   CalculatorEngine( CORBA::ORB_ptr orb,
50                       PortableServer::POA_ptr poa,
51                       PortableServer::ObjectId * contId, 
52                       const char *instanceName,
53                       const char *interfaceName);
54
55   virtual ~CalculatorEngine();
56
57
58   SALOME_MED::FIELDDOUBLE_ptr PutToStudy(SALOME_MED::FIELDDOUBLE_ptr theField,
59                                          CORBA::Long theStudyId);
60
61   SALOME_MED::FIELDDOUBLE_ptr Add(SALOME_MED::FIELDDOUBLE_ptr FirstField,
62                                   SALOME_MED::FIELDDOUBLE_ptr SecondField);
63
64   SALOME_MED::FIELDDOUBLE_ptr Mul(SALOME_MED::FIELDDOUBLE_ptr OldField,
65                                   CORBA::Double x1);
66
67   SALOME_MED::FIELDDOUBLE_ptr Constant(SALOME_MED::FIELDDOUBLE_ptr FirstField,
68                                        CORBA::Double x1);
69
70   void writeMEDfile(SALOME_MED::FIELDDOUBLE_ptr field1 , 
71                     const char *fileName);
72
73 private:
74
75   SALOME_NamingService * _NS ; 
76
77 };
78
79 extern "C"
80   PortableServer::ObjectId * CalculatorEngine_factory
81                             (CORBA::ORB_ptr orb ,
82                              PortableServer::POA_ptr poa , 
83                              PortableServer::ObjectId * contId ,
84                              const char *instanceName ,
85                              const char *interfaceName ) ;
86
87 #endif