Salome HOME
bc280dd7846b273702a92774295f5cccc2859b44
[samples/calculator.git] / src / CALCULATOR / CALCULATOR.hxx
1 // Copyright (C) 2007-2021  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, or (at your option) any later version.
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 #ifndef CALCULATOR_HXX
24 #define CALCULATOR_HXX
25
26 #ifdef WIN32
27 #  if defined CALCULATOREngine_EXPORTS
28 #    define CALCULATORENGINE_EXPORT __declspec( dllexport )
29 #  else
30 #    define CALCULATORENGINE_EXPORT __declspec( dllimport )
31 #  endif
32 #else
33 #  define CALCULATORENGINE_EXPORT
34 #endif
35
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(CALCULATOR_Gen)
38 #include CORBA_CLIENT_HEADER(MEDCouplingCorbaServant)
39 #include <SALOME_Component_i.hxx>
40
41 class CALCULATORENGINE_EXPORT CALCULATOR_Abstract:
42   public POA_CALCULATOR_ORB::CALCULATOR_Gen,
43   public Engines_Component_i 
44 {
45 public:
46   CALCULATOR_Abstract( CORBA::ORB_ptr,
47                        PortableServer::POA_ptr,
48                        PortableServer::ObjectId*, 
49                        const char*, 
50                        const char*,
51                        bool withRegistry = true );
52     virtual ~CALCULATOR_Abstract();
53     virtual char* getVersion();
54
55     CORBA::Double convergenceCriteria( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr );
56     CORBA::Double normMax( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr );
57     CORBA::Double normL2( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr );
58     CORBA::Double norm2( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr );
59     CORBA::Double normL1( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr );
60     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr applyLin( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr,
61                                                                    CORBA::Double, CORBA::Double );
62     SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr add( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr,
63                                                               SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr );
64     void printField( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr );
65     void cloneField( SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_ptr,
66                      SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out,
67                      SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out,
68                      SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out,
69                      SALOME_MED::MEDCouplingFieldDoubleCorbaInterface_out );
70     CORBA::Boolean isDone();
71     CALCULATOR_ORB::ErrorCode getErrorCode();
72
73 protected:
74     CALCULATOR_ORB::ErrorCode _errorCode;
75 };
76
77 class CALCULATORENGINE_EXPORT CALCULATOR_Session : public CALCULATOR_Abstract
78 {
79 public:
80   CALCULATOR_Session( CORBA::ORB_ptr orb,
81                       PortableServer::POA_ptr poa,
82                       PortableServer::ObjectId* contId, 
83                       const char* instanceName, 
84                       const char* interfaceName)
85     : CALCULATOR_Abstract(orb, poa, contId, instanceName, interfaceName, true) {}
86 };
87
88 class CALCULATORENGINE_EXPORT CALCULATOR_No_Session : public CALCULATOR_Abstract
89 {
90 public:
91   CALCULATOR_No_Session( CORBA::ORB_ptr orb,
92                          PortableServer::POA_ptr poa,
93                          PortableServer::ObjectId* contId, 
94                          const char* instanceName, 
95                          const char* interfaceName)
96     : CALCULATOR_Abstract(orb, poa, contId, instanceName, interfaceName, false) { }
97 };
98
99
100 #endif // CALCULATOR_HXX