Salome HOME
bos #26460 SSL mode implementation
authorrnv <rnv@opencascade.com>
Wed, 22 Dec 2021 10:44:08 +0000 (13:44 +0300)
committervsr <vsr@opencascade.com>
Mon, 17 Jan 2022 11:58:22 +0000 (14:58 +0300)
29 files changed:
resources/CMakeLists.txt
src/MEDCalc/CMakeLists.txt
src/MEDCalc/cmp/CMakeLists.txt
src/MEDCalc/cmp/MED.cxx
src/MEDCalc/cmp/MED.hxx
src/MEDCalc/cmp/MEDFactoryClient.cxx
src/MEDCalc/cmp/MEDFactory_Component_Generator.cxx [new file with mode: 0644]
src/MEDCalc/cmp/MEDFactory_Component_Generator.hxx [new file with mode: 0644]
src/MEDCalc/cmp/MEDFactory_No_Session_i.cxx [new file with mode: 0644]
src/MEDCalc/cmp/MEDFactory_No_Session_i.hxx [new file with mode: 0644]
src/MEDCalc/cmp/MEDFactory_Session_i.cxx [new file with mode: 0644]
src/MEDCalc/cmp/MEDFactory_Session_i.hxx [new file with mode: 0644]
src/MEDCalc/cmp/MEDFactory_i.cxx
src/MEDCalc/cmp/MEDFactory_i.hxx
src/MEDCalc/cmp/MED_Component_Generator.cxx [new file with mode: 0644]
src/MEDCalc/cmp/MED_Component_Generator.hxx [new file with mode: 0644]
src/MEDCalc/cmp/MED_No_Session.cxx [new file with mode: 0644]
src/MEDCalc/cmp/MED_No_Session.hxx [new file with mode: 0644]
src/MEDCalc/cmp/MED_Session.cxx [new file with mode: 0644]
src/MEDCalc/cmp/MED_Session.hxx [new file with mode: 0644]
src/MEDCalc/cmp/_MEDFactory_Session_i.cxx [new file with mode: 0644]
src/MEDCalc/gui/CMakeLists.txt
src/MEDCalc/gui/MEDModule.cxx
src/MEDCalc/swig/CMakeLists.txt [new file with mode: 0644]
src/MEDCalc/swig/FIELDS_SalomeSessionless.py [new file with mode: 0644]
src/MEDCalc/swig/MEDFactory_SalomeSessionless.py [new file with mode: 0644]
src/MEDCalc/swig/MedHelper.cxx [new file with mode: 0644]
src/MEDCalc/swig/MedHelper.h [new file with mode: 0644]
src/MEDCalc/swig/MedHelper.i [new file with mode: 0644]

index 2149a2e98e928f14b6c04a3c10de3879629ff82b..841b007546e885612df667a5e027042b5d8e8873 100644 (file)
@@ -233,5 +233,6 @@ MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/FIELDSCatalog.xml")
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/FIELDSCatalog.xml.in ${CMAKE_CURRENT_BINARY_DIR}/FIELDSCatalog.xml @ONLY)
 MESSAGE(STATUS "Creation of ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml")
 CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SalomeApp.xml.in ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml @ONLY)
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml RENAME SalomeAppSL.xml DESTINATION ${SALOME_FIELDS_INSTALL_RES_DATA})
 
 INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/FIELDSCatalog.xml ${CMAKE_CURRENT_BINARY_DIR}/SalomeApp.xml DESTINATION ${SALOME_FIELDS_INSTALL_RES_DATA})
index 4e7afd6fdae1fc684671592ddc55b712f828b389..7e222f844d471df1ee8b1878fe9c074d6f732420 100644 (file)
@@ -19,6 +19,7 @@
 
 ADD_SUBDIRECTORY(cmp)
 ADD_SUBDIRECTORY(res)
+ADD_SUBDIRECTORY(swig)
 
 IF(SALOME_BUILD_GUI)
   ADD_SUBDIRECTORY(gui)
index 3eb34835aae3dbc82cba8e6d9190ec974334c9f7..6a518b8222c5e983b9f5b53f1b042db867cd9a95 100644 (file)
@@ -49,6 +49,11 @@ SET(COMMON_SOURCES
   MEDPresentationDeflectionShape.cxx
   MEDPresentationStreamLines.cxx
   MEDPresentationCutSegment.cxx
+  MEDFactory_i.cxx
+  MEDFactory_No_Session_i.cxx
+  MEDFactory_Session_i.cxx
+  MEDFactory_Component_Generator.cxx
+
 )
 
 SET(MEDEngineCommon_SOURCES
@@ -56,11 +61,14 @@ SET(MEDEngineCommon_SOURCES
 )
 
 SET(MEDFactoryEngine_SOURCES
-  MEDFactory_i.cxx
+    _MEDFactory_Session_i.cxx
 )
 
 SET(MEDEngine_SOURCES
   MED.cxx
+  MED_Session.cxx
+  MED_No_Session.cxx
+  MED_Component_Generator.cxx
 )
 
 SET(COMMON_LIBS
index d6b4d0903454f9eff152b4ecbfb136cd73bb0ce8..fceead5b682ac767e2354978d7bb99dbb855af53 100644 (file)
@@ -49,8 +49,9 @@ MED::MED(CORBA::ORB_ptr orb,
          PortableServer::POA_ptr poa,
          PortableServer::ObjectId* contId,
          const char* instanceName,
-         const char* interfaceName)
-  : Engines_Component_i(orb, poa, contId, instanceName, interfaceName),
+         const char* interfaceName,
+                bool checkNS)
+  : Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, checkNS),
     _fieldSeriesEntries(),
     _meshEntries()
 {
@@ -464,25 +465,3 @@ void MED::cleanUp()
   _fieldSeriesEntries.clear();
   _meshEntries.clear();
 }
-
-extern "C"
-{
-  /*!
-    \brief Exportable factory function: create an instance of the MED component engine
-    \param orb reference to the ORB
-    \param poa reference to the POA
-    \param contId CORBA object ID, pointing to the owner SALOME container
-    \param instanceName SALOME component instance name
-    \param interfaceName SALOME component interface name
-    \return CORBA object identifier of the registered servant
-  */
-  PortableServer::ObjectId* FIELDSEngine_factory(CORBA::ORB_ptr orb,
-                                              PortableServer::POA_ptr poa,
-                                              PortableServer::ObjectId* contId,
-                                              const char* instanceName,
-                                              const char* interfaceName)
-  {
-    MED* component = new MED(orb, poa, contId, instanceName, interfaceName);
-    return component->getId();
-  }
-}
index b18a0ee3e7c59b6b92329131cb60e8646e3783e7..bbee820e5203eeeb38201e32185406eab81302a9 100644 (file)
@@ -40,7 +40,8 @@ public:
       PortableServer::POA_ptr poa,
       PortableServer::ObjectId* contId,
       const char* instanceName,
-      const char* interfaceName);
+      const char* interfaceName,
+         bool checkNS = true);
   virtual ~MED();
 
   MED_ORB::status addDatasourceToStudy(const MEDCALC::DatasourceHandler& datasourceHandler);
@@ -78,17 +79,12 @@ public:
   virtual CORBA::Boolean hasObjectInfo();
   virtual char* getObjectInfo(const char* entry);
 
+  // Get Study
+  virtual SALOMEDS::Study_var getStudyServant() = 0;
+
  private:
   std::map<long, std::string> _fieldSeriesEntries;
   std::map<long, std::string> _meshEntries;
 };
 
-extern "C"
-MEDCALC_EXPORT
-PortableServer::ObjectId* FIELDSEngine_factory( CORBA::ORB_ptr orb,
-                                               PortableServer::POA_ptr poa,
-                                               PortableServer::ObjectId* contId,
-                                               const char* instanceName,
-                                               const char* interfaceName );
-
 #endif
index 2190da8322b4a560f0077d67a4f44db7c8c0ef96..56bf3bbb39528c566d5314fb8c3eb499dc096c23 100644 (file)
 
 // Author : Guillaume Boulant (EDF)
 
+#include <SALOME_KernelServices.hxx>
+
 #include "MEDFactoryClient.hxx"
-#include "SALOME_KernelServices.hxx"
+#include "MEDFactory_Component_Generator.hxx"
 
 namespace MEDFactoryClient {
 
@@ -30,9 +32,18 @@ namespace MEDFactoryClient {
   MEDCALC::MEDFactory_ptr getFactory() {
     static MEDCALC::MEDFactory_ptr engine;
     if(CORBA::is_nil(engine)){
-      Engines::EngineComponent_var component =
-        KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","MEDFactory" );
-      engine = MEDCALC::MEDFactory::_narrow(component);
+               SALOME_NamingService_Abstract *ns = KERNEL::getNamingService();
+               if (dynamic_cast<SALOME_NamingService *>(ns)) {
+                       Engines::EngineComponent_var component =
+                       KERNEL::getLifeCycleCORBA()->FindOrLoad_Component( "FactoryServer","MEDFactory" );
+                       engine = MEDCALC::MEDFactory::_narrow(component);
+               }
+               else {
+                       Engines::EngineComponent_var component = RetrieveMEDFactoryInstance();
+                       CORBA::Object_var comp2 = CORBA::Object::_narrow(component);
+                       KERNEL::RegisterCompo("MEDFactory", comp2);
+                       engine = MEDCALC::MEDFactory::_narrow(component);
+               }
     }
     return engine;
   }
diff --git a/src/MEDCalc/cmp/MEDFactory_Component_Generator.cxx b/src/MEDCalc/cmp/MEDFactory_Component_Generator.cxx
new file mode 100644 (file)
index 0000000..61f3b5f
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "MEDFactory_Component_Generator.hxx"
+
+#include "MEDFactory_No_Session_i.hxx"
+#include "SALOME_Container_i.hxx"
+#include "SALOME_KernelServices.hxx"
+
+#include <cstring>
+
+static Engines::EngineComponent_var _unique_compo;
+
+Engines::EngineComponent_var RetrieveMEDFactoryInstance()
+{
+       constexpr char COMPO_NAME[] = "MEDFactory";
+       if (CORBA::is_nil(_unique_compo))
+       {
+               CORBA::ORB_var orb;
+               {
+                       int argc(0);
+                       orb = CORBA::ORB_init(argc, nullptr);
+               }
+               CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+               PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
+               PortableServer::POAManager_var pman = poa->the_POAManager();
+               CORBA::PolicyList policies;
+               policies.length(0);
+               auto *cont(KERNEL::getContainerSA());
+               PortableServer::ObjectId *conId(cont->getCORBAId());
+               //
+               pman->activate();
+               //
+               MEDFactory_No_Session_i *servant = new MEDFactory_No_Session_i(orb, poa, conId, "MEDFactory_inst_2", COMPO_NAME);
+               PortableServer::ObjectId *zeId = servant->getId();
+               CORBA::Object_var zeRef = poa->id_to_reference(*zeId);
+               KERNEL::RegisterCompo(COMPO_NAME, zeRef);
+               _unique_compo = Engines::EngineComponent::_narrow(zeRef);
+       }
+       return _unique_compo;
+}
diff --git a/src/MEDCalc/cmp/MEDFactory_Component_Generator.hxx b/src/MEDCalc/cmp/MEDFactory_Component_Generator.hxx
new file mode 100644 (file)
index 0000000..664c00f
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "MEDCALC.hxx"
+
+#include "SALOMEconfig.h"
+
+#include CORBA_SERVER_HEADER(MED_Gen)
+
+MEDCALC_EXPORT Engines::EngineComponent_var RetrieveMEDFactoryInstance();
diff --git a/src/MEDCalc/cmp/MEDFactory_No_Session_i.cxx b/src/MEDCalc/cmp/MEDFactory_No_Session_i.cxx
new file mode 100644 (file)
index 0000000..2fd0c06
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (C) 2015-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "MEDFactory_No_Session_i.hxx"
+
+MEDFactory_No_Session_i::MEDFactory_No_Session_i(CORBA::ORB_ptr orb,
+       PortableServer::POA_ptr poa,
+       PortableServer::ObjectId* contId,
+       const char* instanceName,
+       const char* interfaceName)
+       : MEDFactory_i(orb, poa, contId, instanceName, interfaceName, false)
+{
+}
diff --git a/src/MEDCalc/cmp/MEDFactory_No_Session_i.hxx b/src/MEDCalc/cmp/MEDFactory_No_Session_i.hxx
new file mode 100644 (file)
index 0000000..209783c
--- /dev/null
@@ -0,0 +1,35 @@
+// Copyright (C) 2015-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "MEDFactory_i.hxx"
+
+class MEDCALC_EXPORT MEDFactory_No_Session_i : public MEDFactory_i
+{
+public:
+       MEDFactory_No_Session_i(CORBA::ORB_ptr orb,
+               PortableServer::POA_ptr poa,
+               PortableServer::ObjectId * contId,
+               const char *instanceName,
+               const char *interfaceName);
+
+};
+
+
diff --git a/src/MEDCalc/cmp/MEDFactory_Session_i.cxx b/src/MEDCalc/cmp/MEDFactory_Session_i.cxx
new file mode 100644 (file)
index 0000000..425a09b
--- /dev/null
@@ -0,0 +1,29 @@
+// Copyright (C) 2015-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "MEDFactory_Session_i.hxx"
+
+MEDFactory_Session_i::MEDFactory_Session_i(CORBA::ORB_ptr orb,
+                       PortableServer::POA_ptr poa,
+                       PortableServer::ObjectId* contId,
+                       const char* instanceName,
+                       const char* interfaceName)
+       : MEDFactory_i(orb, poa, contId, instanceName, interfaceName, true)
+{
+}
diff --git a/src/MEDCalc/cmp/MEDFactory_Session_i.hxx b/src/MEDCalc/cmp/MEDFactory_Session_i.hxx
new file mode 100644 (file)
index 0000000..a30f26a
--- /dev/null
@@ -0,0 +1,42 @@
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "MEDFactory_i.hxx"
+
+class MEDCALC_EXPORT MEDFactory_Session_i : public MEDFactory_i
+{
+
+public:
+
+       MEDFactory_Session_i(CORBA::ORB_ptr orb,
+               PortableServer::POA_ptr poa,
+               PortableServer::ObjectId * contId,
+               const char *instanceName,
+               const char *interfaceName);
+};
+
+extern "C"
+MEDCALC_EXPORT PortableServer::ObjectId *
+MEDFactoryEngine_factory(CORBA::ORB_ptr orb,
+       PortableServer::POA_ptr poa,
+       PortableServer::ObjectId * contId,
+       const char *instanceName,
+       const char *interfaceName);
index cf626de99748cc7cd795983d5f8d28f9f298e012..657ff2f1ec40fe7a46bd81eaca508d8e9d3b3901 100644 (file)
@@ -37,8 +37,9 @@ MEDFactory_i::MEDFactory_i(CORBA::ORB_ptr orb,
                            PortableServer::POA_ptr poa,
                            PortableServer::ObjectId* contId,
                            const char* instanceName,
-                           const char* interfaceName)
-  : Engines_Component_i(orb, poa, contId, instanceName, interfaceName)
+                           const char* interfaceName,
+                                                  bool checkNS)
+  : Engines_Component_i(orb, poa, contId, instanceName, interfaceName, false, checkNS)
 {
   MESSAGE("activate object");
   _thisObj = this ;
@@ -81,21 +82,3 @@ MEDFactory_i::getCommandsHistoryManager()
   MEDCALC::MEDCommandsHistoryManager_ptr managerPtr = manager->_this();
   return managerPtr;
 }
-
-extern "C"
-{
-  PortableServer::ObjectId* MEDFactoryEngine_factory(
-             CORBA::ORB_ptr orb,
-             PortableServer::POA_ptr poa,
-             PortableServer::ObjectId* contId,
-             const char* instanceName,
-             const char* interfaceName)
-  {
-    MESSAGE("PortableServer::ObjectId * MEDEngine_factory()");
-    SCRUTE(interfaceName);
-    MEDFactory_i* factory = new MEDFactory_i(orb, poa, contId,
-                                             instanceName,
-                                             interfaceName);
-    return factory->getId() ;
-  }
-}
index 3311189f48da1c047b1df369d62201021637c522..a2e3d10672b0eb7f402b0c0b1f24a28422139f6f 100644 (file)
@@ -41,7 +41,8 @@ public:
                PortableServer::POA_ptr poa,
                PortableServer::ObjectId * contId,
                const char *instanceName,
-               const char *interfaceName);
+               const char *interfaceName,
+                          bool checkNS = true);
   virtual ~MEDFactory_i();
 
   /*! Returns the singleton instance of the data manager */
@@ -54,12 +55,4 @@ public:
   MEDCALC::MEDCommandsHistoryManager_ptr getCommandsHistoryManager();
 };
 
-extern "C"
-MEDCALC_EXPORT PortableServer::ObjectId *
-MEDFactoryEngine_factory(CORBA::ORB_ptr orb,
-                         PortableServer::POA_ptr poa,
-                         PortableServer::ObjectId * contId,
-                         const char *instanceName,
-                         const char *interfaceName);
-
 #endif
diff --git a/src/MEDCalc/cmp/MED_Component_Generator.cxx b/src/MEDCalc/cmp/MED_Component_Generator.cxx
new file mode 100644 (file)
index 0000000..6d1e616
--- /dev/null
@@ -0,0 +1,57 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "MED_Component_Generator.hxx"
+
+#include "MED_No_Session.hxx"
+#include "SALOME_Container_i.hxx"
+#include "SALOME_KernelServices.hxx"
+
+#include <cstring>
+
+static Engines::EngineComponent_var _unique_compo;
+
+Engines::EngineComponent_var RetrieveMEDInstance()
+{
+  constexpr char COMPO_NAME[]="FIELDS";
+  if (CORBA::is_nil(_unique_compo))
+  {
+    CORBA::ORB_var orb;
+    {
+      int argc(0);
+      orb = CORBA::ORB_init(argc, nullptr);
+    }
+    CORBA::Object_var obj = orb->resolve_initial_references("RootPOA");
+    PortableServer::POA_var poa = PortableServer::POA::_narrow(obj);
+    PortableServer::POAManager_var pman = poa->the_POAManager();
+    CORBA::PolicyList policies;
+    policies.length(0);
+    auto *cont(KERNEL::getContainerSA());
+    PortableServer::ObjectId *conId(cont->getCORBAId());
+    //
+    pman->activate();
+    //
+    MED_No_Session *servant = new MED_No_Session(orb, poa, conId, "FIELDS_inst_2", COMPO_NAME);
+    PortableServer::ObjectId *zeId = servant->getId();
+    CORBA::Object_var zeRef = poa->id_to_reference(*zeId);
+    KERNEL::RegisterCompo(COMPO_NAME,zeRef);
+    _unique_compo = Engines::EngineComponent::_narrow(zeRef);
+  }
+  return _unique_compo;
+}
diff --git a/src/MEDCalc/cmp/MED_Component_Generator.hxx b/src/MEDCalc/cmp/MED_Component_Generator.hxx
new file mode 100644 (file)
index 0000000..8087cc1
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "MEDCALC.hxx"
+
+#include "SALOMEconfig.h"
+
+#include CORBA_SERVER_HEADER(MED_Gen)
+
+MEDCALC_EXPORT Engines::EngineComponent_var RetrieveMEDInstance();
diff --git a/src/MEDCalc/cmp/MED_No_Session.cxx b/src/MEDCalc/cmp/MED_No_Session.cxx
new file mode 100644 (file)
index 0000000..46fac35
--- /dev/null
@@ -0,0 +1,39 @@
+// Copyright (C) 2015-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+
+#include "MED_No_Session.hxx"
+#ifdef GetObject
+#undef GetObject
+#endif
+#include "SALOMEDS_Study_i.hxx"
+
+                               
+MED_No_Session::MED_No_Session(CORBA::ORB_ptr orb,
+                               PortableServer::POA_ptr poa,
+                               PortableServer::ObjectId *contId,
+                               const char *instanceName,
+                               const char *interfaceName):MED(orb,poa,contId,instanceName,interfaceName, false)
+{
+}
+
+SALOMEDS::Study_var MED_No_Session::getStudyServant()
+{
+  return SALOMEDS::Study::_duplicate(KERNEL::getStudyServantSA());
+}
diff --git a/src/MEDCalc/cmp/MED_No_Session.hxx b/src/MEDCalc/cmp/MED_No_Session.hxx
new file mode 100644 (file)
index 0000000..9516ac9
--- /dev/null
@@ -0,0 +1,34 @@
+// Copyright (C) 2015-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "MED.hxx"
+
+class MEDCALC_EXPORT MED_No_Session : public MED
+{
+ public:
+  MED_No_Session(CORBA::ORB_ptr orb,
+                 PortableServer::POA_ptr poa,
+                 PortableServer::ObjectId * contId,
+                 const char *instanceName,
+                 const char *interfaceName);
+
+  SALOMEDS::Study_var getStudyServant() override;
+};
diff --git a/src/MEDCalc/cmp/MED_Session.cxx b/src/MEDCalc/cmp/MED_Session.cxx
new file mode 100644 (file)
index 0000000..5437eba
--- /dev/null
@@ -0,0 +1,67 @@
+// Copyright (C) 2015-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "MED_Session.hxx"
+
+MED_Session::MED_Session(CORBA::ORB_ptr orb,
+                        PortableServer::POA_ptr poa,
+                        PortableServer::ObjectId *contId,
+                        const char *instanceName,
+                        const char *interfaceName):MED(orb,poa,contId,instanceName,interfaceName, true)
+{
+  name_service = new SALOME_NamingService(_orb);
+}
+
+MED_Session::~MED_Session()
+{
+
+}
+
+SALOMEDS::Study_var MED_Session::getStudyServant()
+{
+  static SALOMEDS::Study_var aStudy;
+  if(CORBA::is_nil(aStudy))
+  {
+    CORBA::Object_ptr anObject = name_service->Resolve("/Study");
+    aStudy = SALOMEDS::Study::_narrow(anObject);
+  }
+  return aStudy;
+}
+
+extern "C"
+{
+  /*!
+    \brief Exportable factory function: create an instance of the MED component engine
+    \param orb reference to the ORB
+    \param poa reference to the POA
+    \param contId CORBA object ID, pointing to the owner SALOME container
+    \param instanceName SALOME component instance name
+    \param interfaceName SALOME component interface name
+    \return CORBA object identifier of the registered servant
+  */
+  PortableServer::ObjectId* FIELDSEngine_factory(CORBA::ORB_ptr orb,
+                                              PortableServer::POA_ptr poa,
+                                              PortableServer::ObjectId* contId,
+                                              const char* instanceName,
+                                              const char* interfaceName)
+  {
+    MED* component = new MED_Session(orb, poa, contId, instanceName, interfaceName);
+    return component->getId();
+  }
+}
diff --git a/src/MEDCalc/cmp/MED_Session.hxx b/src/MEDCalc/cmp/MED_Session.hxx
new file mode 100644 (file)
index 0000000..f67788d
--- /dev/null
@@ -0,0 +1,45 @@
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#pragma once
+
+#include "MED.hxx"
+#include "SALOME_NamingService.hxx"
+
+class MEDCALC_EXPORT MED_Session : public MED
+{
+public:
+  MED_Session(CORBA::ORB_ptr orb,
+              PortableServer::POA_ptr poa,
+              PortableServer::ObjectId * contId,
+              const char *instanceName,
+              const char *interfaceName);
+  ~MED_Session();
+  SALOMEDS::Study_var getStudyServant() override;
+private: 
+  SALOME_NamingService *name_service = nullptr;
+};
+
+extern "C"
+MEDCALC_EXPORT
+PortableServer::ObjectId* FIELDSEngine_factory( CORBA::ORB_ptr orb,
+                                               PortableServer::POA_ptr poa,
+                                               PortableServer::ObjectId* contId,
+                                               const char* instanceName,
+                                               const char* interfaceName );
diff --git a/src/MEDCalc/cmp/_MEDFactory_Session_i.cxx b/src/MEDCalc/cmp/_MEDFactory_Session_i.cxx
new file mode 100644 (file)
index 0000000..390404e
--- /dev/null
@@ -0,0 +1,41 @@
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+// Authors : Guillaume Boulant (EDF) - 01/06/2011
+
+#include "MEDFactory_Session_i.hxx"
+
+
+extern "C"
+{
+       PortableServer::ObjectId* MEDFactoryEngine_factory(
+               CORBA::ORB_ptr orb,
+               PortableServer::POA_ptr poa,
+               PortableServer::ObjectId* contId,
+               const char* instanceName,
+               const char* interfaceName)
+       {
+               MESSAGE("PortableServer::ObjectId * MEDEngine_factory()");
+               SCRUTE(interfaceName);
+               MEDFactory_i* factory = new MEDFactory_Session_i(orb, poa, contId,
+                       instanceName,
+                       interfaceName);
+               return factory->getId();
+       }
+}
index ba372d93f4e39c1ab4dad2d363e585a9a60e52e7..d597b9c42bae5f81a4a7bd9e4c5ed092ffe282ce 100644 (file)
@@ -121,6 +121,7 @@ SET(link_libraries
   SalomeIDLMED
   MEDCALCGUI_dialogs
   MEDFactoryEngine
+  FIELDSEngine
   ${GUI_qtx}
   ${GUI_suit}
   ${GUI_SalomeObject}
index 8c2f40105e7213a4f1c1361704b42d4d5e7e18d5..78659c775256679c4a26adc76ed9d96df5e6578a 100644 (file)
@@ -51,6 +51,7 @@
 
 #include "MEDFactoryClient.hxx"
 #include "MEDPresentationManager_i.hxx"
+#include "MED_Component_Generator.hxx"
 
 #include <QTimer>
 #include <sstream>
@@ -109,11 +110,18 @@ void
 MEDModule::init()
 {
   // initialize FIELDS module engine (load, if necessary)
+  Engines::EngineComponent_var comp;
   if ( CORBA::is_nil( _MED_engine ) ) {
-    Engines::EngineComponent_var comp =
-      SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "FIELDS" );
-    if (CORBA::is_nil( comp )) {
-      STDLOG("Could not FindOrLoad_Component FIELDS");
+    SALOME_NamingService_Abstract *ns = SalomeApp_Application::namingService();
+    if( dynamic_cast<SALOME_NamingService *>(ns) )
+    {
+      comp = SalomeApp_Application::lcc()->FindOrLoad_Component( "FactoryServer", "FIELDS" );
+    }
+    else
+    {
+      comp = RetrieveMEDInstance();
+      CORBA::Object_var comp2 = CORBA::Object::_narrow(comp);
+      KERNEL::RegisterCompo("FIELDS",comp2);
     }
     _MED_engine = MED_ORB::MED_Gen::_narrow( comp );
     if (CORBA::is_nil( _MED_engine )) {
diff --git a/src/MEDCalc/swig/CMakeLists.txt b/src/MEDCalc/swig/CMakeLists.txt
new file mode 100644 (file)
index 0000000..5037ad9
--- /dev/null
@@ -0,0 +1,57 @@
+# Copyright (C) 2012-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+include(${SWIG_USE_FILE})
+
+include_directories(
+  ${KERNEL_INCLUDE_DIRS}
+  ${PROJECT_BINARY_DIR}/idl
+  ${PROJECT_SOURCE_DIR}/src/MEDCalc/cmp
+)
+
+SET(_bin_SCRIPTS
+  FIELDS_SalomeSessionless.py
+  MEDFactory_SalomeSessionless.py
+)
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(${OMNIORB_DEFINITIONS}  )
+
+# SWIG wrapping
+SET(MedHelper_HEADERS MedHelper.h MedHelper.i)
+SET(MedHelper_SOURCES MedHelper.cxx ${MedHelper_HEADERS})
+SET_SOURCE_FILES_PROPERTIES(MedHelper.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(MedHelper.i PROPERTIES SWIG_FLAGS "-py3")
+SET_SOURCE_FILES_PROPERTIES(MedHelper_wrap.cpp PROPERTIES COMPILE_FLAGS "-DHAVE_CONFIG_H")
+SET(_swig_SCRIPTS ${CMAKE_CURRENT_BINARY_DIR}/MedHelper.py)
+IF(${CMAKE_VERSION} VERSION_LESS "3.8.0") 
+  SWIG_ADD_MODULE(MedHelper python ${MedHelper_SOURCES})
+ELSE()
+  SWIG_ADD_LIBRARY(MedHelper LANGUAGE python SOURCES ${MedHelper_SOURCES})
+ENDIF()
+SWIG_LINK_LIBRARIES(MedHelper ${PYTHON_LIBRARIES} ${PLATFORM_LIBS} FIELDSEngine MEDEngineCommon ${KERNEL_SalomeKernelHelpers} ${KERNEL_SalomeDS} )
+SWIG_CHECK_GENERATION(MedHelper)
+IF(WIN32)
+  SET_TARGET_PROPERTIES(_MedHelper PROPERTIES DEBUG_OUTPUT_NAME _MedHelper_d)
+ENDIF(WIN32)
+install(TARGETS _MedHelper DESTINATION ${SALOME_INSTALL_LIBS})
+install(FILES ${MedHelper_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS})
+SALOME_INSTALL_SCRIPTS("${_swig_SCRIPTS}"  ${SALOME_INSTALL_BINS} EXTRA_DPYS "${SWIG_MODULE_MedHelper_REAL_NAME}")
+
+SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_PYTHON} DEF_PERMS)
diff --git a/src/MEDCalc/swig/FIELDS_SalomeSessionless.py b/src/MEDCalc/swig/FIELDS_SalomeSessionless.py
new file mode 100644 (file)
index 0000000..7647388
--- /dev/null
@@ -0,0 +1,28 @@
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+def buildInstance(orb):
+    import MedHelper
+    med_ior = MedHelper.BuildMEDInstance()
+    import MED_ORB
+    import CORBA
+    orb=CORBA.ORB_init([''])
+    med = orb.string_to_object(med_ior)
+    return med, orb
diff --git a/src/MEDCalc/swig/MEDFactory_SalomeSessionless.py b/src/MEDCalc/swig/MEDFactory_SalomeSessionless.py
new file mode 100644 (file)
index 0000000..fbc0a18
--- /dev/null
@@ -0,0 +1,28 @@
+#  -*- coding: iso-8859-1 -*-
+# Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+def buildInstance(orb):
+    import MedHelper
+    med_field_ior = MedHelper.BuildMEDFactoryInstance()
+    import MEDCALC
+    import CORBA
+    orb=CORBA.ORB_init([''])
+    med_factory = orb.string_to_object(med_field_ior)
+    return med_factory, orb
diff --git a/src/MEDCalc/swig/MedHelper.cxx b/src/MEDCalc/swig/MedHelper.cxx
new file mode 100644 (file)
index 0000000..8d78add
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include "MedHelper.h"
+
+#include "SALOME_KernelServices.hxx"
+
+#include "MED_Component_Generator.hxx"
+#include "MEDFactory_Component_Generator.hxx"
+
+std::string BuildMEDInstance()
+{
+  Engines::EngineComponent_var zeRef = RetrieveMEDInstance();
+  CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef);
+  return std::string(ior.in());
+}
+
+std::string BuildMEDFactoryInstance()
+{
+  Engines::EngineComponent_var zeRef = RetrieveMEDFactoryInstance();
+  CORBA::String_var ior = KERNEL::getORB()->object_to_string(zeRef);
+  return std::string(ior.in());
+}
+
diff --git a/src/MEDCalc/swig/MedHelper.h b/src/MEDCalc/swig/MedHelper.h
new file mode 100644 (file)
index 0000000..d200c32
--- /dev/null
@@ -0,0 +1,23 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+#include <string>
+
+std::string BuildMEDInstance();
+std::string BuildMEDFactoryInstance();
diff --git a/src/MEDCalc/swig/MedHelper.i b/src/MEDCalc/swig/MedHelper.i
new file mode 100644 (file)
index 0000000..fe6f256
--- /dev/null
@@ -0,0 +1,28 @@
+// Copyright (C) 2021  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
+%module MedHelper
+
+%include "std_string.i"
+
+%inline
+{
+  std::string BuildMEDInstance();
+  std::string BuildMEDFactoryInstance();
+}