]> SALOME platform Git repositories - samples/component.git/blob - src/CalculatorComponent/CalculatorEngine.hxx
Salome HOME
4e5cf7006d17d80bf63a8357a6f4205ea30ba8c6
[samples/component.git] / src / CalculatorComponent / CalculatorEngine.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 //  File   : CalculatorEngine.hxx
24 //  Author : Laurent DADA, CEA
25 //  Module : CalculatorComponent
26 //  $Header   :  Exp $
27 //
28 #ifndef _CALCULATORWRAPPER_HXX_
29 #define _CALCULATORWRAPPER_HXX_
30
31 // IDL headers
32 #include <string>
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(Calculator)
35 #include "SALOME_Component_i.hxx"
36 #include CORBA_CLIENT_HEADER(MED)
37 #include "MEDMEM_Med_i.hxx"
38 #include "MEDMEM_Field.hxx"
39 #include "MEDMEM_FieldTemplate_i.hxx"
40
41 #include "SALOME_NamingService.hxx"
42
43 class CalculatorEngine :  
44   virtual public POA_SuperVisionTest::Calculator,
45   public Engines_Component_i 
46 {
47
48 public:
49   CalculatorEngine() ;
50   CalculatorEngine( CORBA::ORB_ptr orb,
51                       PortableServer::POA_ptr poa,
52                       PortableServer::ObjectId * contId, 
53                       const char *instanceName,
54                       const char *interfaceName);
55
56   virtual ~CalculatorEngine();
57
58   virtual char* getVersion();
59
60   SALOME_MED::FIELDDOUBLE_ptr PutToStudy(SALOME_MED::FIELDDOUBLE_ptr theField,
61                                          CORBA::Long theStudyId);
62
63   SALOME_MED::FIELDDOUBLE_ptr Add(SALOME_MED::FIELDDOUBLE_ptr FirstField,
64                                   SALOME_MED::FIELDDOUBLE_ptr SecondField);
65
66   SALOME_MED::FIELDDOUBLE_ptr Mul(SALOME_MED::FIELDDOUBLE_ptr OldField,
67                                   CORBA::Double x1);
68
69   SALOME_MED::FIELDDOUBLE_ptr Constant(SALOME_MED::FIELDDOUBLE_ptr FirstField,
70                                        CORBA::Double x1);
71
72   void writeMEDfile(SALOME_MED::FIELDDOUBLE_ptr field1 , 
73                     const char *fileName);
74
75 private:
76
77   SALOME_NamingService * _NS ; 
78
79 };
80
81 extern "C"
82   PortableServer::ObjectId * CalculatorEngine_factory
83                             (CORBA::ORB_ptr orb ,
84                              PortableServer::POA_ptr poa , 
85                              PortableServer::ObjectId * contId ,
86                              const char *instanceName ,
87                              const char *interfaceName ) ;
88
89 #endif