Salome HOME
1ce4f1ecd3eeaad24aa67b24d702c3195ab45e27
[samples/component.git] / src / CalculatorComponent / CalculatorEngine.hxx
1 // Copyright (C) 2007-2012  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
59   SALOME_MED::FIELDDOUBLE_ptr PutToStudy(SALOME_MED::FIELDDOUBLE_ptr theField,
60                                          CORBA::Long theStudyId);
61
62   SALOME_MED::FIELDDOUBLE_ptr Add(SALOME_MED::FIELDDOUBLE_ptr FirstField,
63                                   SALOME_MED::FIELDDOUBLE_ptr SecondField);
64
65   SALOME_MED::FIELDDOUBLE_ptr Mul(SALOME_MED::FIELDDOUBLE_ptr OldField,
66                                   CORBA::Double x1);
67
68   SALOME_MED::FIELDDOUBLE_ptr Constant(SALOME_MED::FIELDDOUBLE_ptr FirstField,
69                                        CORBA::Double x1);
70
71   void writeMEDfile(SALOME_MED::FIELDDOUBLE_ptr field1 , 
72                     const char *fileName);
73
74 private:
75
76   SALOME_NamingService * _NS ; 
77
78 };
79
80 extern "C"
81   PortableServer::ObjectId * CalculatorEngine_factory
82                             (CORBA::ORB_ptr orb ,
83                              PortableServer::POA_ptr poa , 
84                              PortableServer::ObjectId * contId ,
85                              const char *instanceName ,
86                              const char *interfaceName ) ;
87
88 #endif