Salome HOME
MERGE stage 1: keep doc/dev and src/MEDCalc/doc
[modules/med.git] / src / MEDCalc / cmp / MED.hxx
1 // Copyright (C) 2015  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef _MED_HXX_
21 #define _MED_HXX_
22
23 #ifdef WIN32
24 # if defined MEDENGINE_EXPORTS || defined MEDEngine_EXPORTS
25 #  define MEDENGINE_EXPORT __declspec( dllexport )
26 # else
27 #  define MEDENGINE_EXPORT __declspec( dllimport )
28 # endif
29 #else
30 # define MEDENGINE_EXPORT
31 #endif
32
33 #include <SALOMEconfig.h>
34 #include CORBA_SERVER_HEADER(MED_Gen)
35 #include CORBA_SERVER_HEADER(MEDDataManager)
36 #include CORBA_CLIENT_HEADER(SALOMEDS)
37 #include <SALOME_Component_i.hxx>
38 #include <SALOMEDS_Study.hxx>
39
40 #include <map>
41 #include <string>
42
43 class MEDENGINE_EXPORT MED :
44   public POA_MED_ORB::MED_Gen,
45   public Engines_Component_i
46 {
47 public:
48   MED(CORBA::ORB_ptr orb,
49       PortableServer::POA_ptr poa,
50       PortableServer::ObjectId* contId,
51       const char* instanceName,
52       const char* interfaceName);
53   virtual ~MED();
54
55   MED_ORB::status addDatasourceToStudy(SALOMEDS::Study_ptr study,
56                                        const MEDCALC::DatasourceHandler& datasourceHandler);
57
58   MED_ORB::status registerPresentation(SALOMEDS::Study_ptr study,
59                                        CORBA::Long fieldId,
60                                        const char* name,
61                                        const char* label);
62
63   /*! Dump the study as a Python file */
64   virtual Engines::TMPFile* DumpPython(CORBA::Object_ptr theStudy,
65                                        CORBA::Boolean isPublished,
66                                        CORBA::Boolean isMultiFile,
67                                        CORBA::Boolean& isValidScript);
68
69  private:
70   std::map<long, std::string> _fieldSeriesEntries;
71 };
72
73 extern "C"
74 MEDENGINE_EXPORT
75 PortableServer::ObjectId* MEDEngine_factory( CORBA::ORB_ptr orb,
76                                              PortableServer::POA_ptr poa,
77                                              PortableServer::ObjectId* contId,
78                                              const char* instanceName,
79                                              const char* interfaceName );
80
81 #endif