Salome HOME
updated copyright message
[modules/kernel.git] / src / LifeCycleCORBA / SALOME_LifeCycleCORBA.hxx
index ced93eb1e82d0d949ace6ea78a9b52535044b922..13a9c52df07b2f27de9620094d5e20daf8cab839 100644 (file)
@@ -1,36 +1,34 @@
-//  SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
-// 
-//  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. 
-// 
-//  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
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// 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
 //
+
 //  File   : SALOME_LifeCycleCORBA.hxx
 //  Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
 //  Module : SALOME
-//  $Header$
 
 #ifndef _SALOME_LIFECYCLECORBA_HXX_
 #define _SALOME_LIFECYCLECORBA_HXX_
 
 #include <stdlib.h>
-#ifndef WNT
+#ifndef WIN32
 #include <unistd.h>
 #endif
 #include <string>
@@ -40,9 +38,9 @@
 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
 #include CORBA_CLIENT_HEADER(SALOME_Component)
 #include <iostream>
-using namespace std;
-#ifdef WNT
-# if defined LIFECYCLECORBA_EXPORTS
+
+#ifdef WIN32
+# if defined LIFECYCLECORBA_EXPORTS || defined SalomeLifeCycleCORBA_EXPORTS
 #  define LIFECYCLECORBA_EXPORT __declspec( dllexport )
 # else
 #  define LIFECYCLECORBA_EXPORT __declspec( dllimport )
@@ -52,7 +50,7 @@ using namespace std;
 #endif
 
 
-class SALOME_NamingService;
+class SALOME_NamingService_Abstract;
 
 class LIFECYCLECORBA_EXPORT IncompatibleComponent : public SALOME_Exception
 {
@@ -64,45 +62,45 @@ public :
 class LIFECYCLECORBA_EXPORT SALOME_LifeCycleCORBA
 {
 public:
-  SALOME_LifeCycleCORBA(SALOME_NamingService *ns = 0);
+  SALOME_LifeCycleCORBA(SALOME_NamingService_Abstract *ns = 0);
   virtual ~SALOME_LifeCycleCORBA();
 
-  Engines::Component_ptr 
-  FindComponent(const Engines::MachineParameters& params,
-               const char *componentName,
-               int studyId=0);
+  Engines::EngineComponent_ptr 
+  FindComponent(const Engines::ContainerParameters& params,
+                const char *componentName);
 
-  Engines::Component_ptr
-  LoadComponent(const Engines::MachineParameters& params,
-               const char *componentName,
-               int studyId=0);
+  Engines::EngineComponent_ptr
+  LoadComponent(const Engines::ContainerParameters& params,
+                const char *componentName);
 
-  Engines::Component_ptr 
-  FindOrLoad_Component(const Engines::MachineParameters& params,
-                      const char *componentName,
-                      int studyId =0);
+  Engines::EngineComponent_ptr 
+  FindOrLoad_Component(const Engines::ContainerParameters& params,
+                       const char *componentName);
 
-  Engines::Component_ptr
+  Engines::EngineComponent_ptr
   FindOrLoad_Component(const char *containerName,
-                      const char *componentName); // for compatibility
+                       const char *componentName);
   
   // Parallel extension
-  Engines::Component_ptr 
-    Load_ParallelComponent(const Engines::MachineParameters& params,
-                           const char *componentName,
-                           int studyId);
+  Engines::EngineComponent_ptr 
+    Load_ParallelComponent(const Engines::ContainerParameters& params,
+                           const char *componentName);
 
   bool isKnownComponentClass(const char *componentName);
 
-  bool isMpiContainer(const Engines::MachineParameters& params)
-    throw(IncompatibleComponent);
+  int NbProc(const Engines::ContainerParameters& params);
 
-  int NbProc(const Engines::MachineParameters& params);
-
-  void preSet(Engines::MachineParameters& params);
+  static void preSet(Engines::ResourceParameters& outparams);
+  static void preSet(Engines::ContainerParameters& outparams);
 
   Engines::ContainerManager_ptr getContainerManager();
   Engines::ResourcesManager_ptr getResourcesManager();
+  SALOME_NamingService_Abstract * namingService();
+  CORBA::ORB_ptr orb();
+  void copyFile(const char* hostSrc, const char* fileSrc, const char* hostDest, const char* fileDest);
+
+  void shutdownServers(bool shutdownLauncher=true);
+  static void killOmniNames();
 
 protected:
 
@@ -111,22 +109,26 @@ protected:
    *  exists among the list of resources in "listOfMachines".
    *  This method uses Naming Service to find the component.
    */
-  Engines::Component_ptr 
-  _FindComponent(const Engines::MachineParameters& params,
-                const char *componentName,
-                int studyId,
-                const Engines::MachineList& listOfMachines);
-
-  Engines::Component_ptr
-  _LoadComponent(const Engines::MachineParameters& params,
-                const char *componentName,
-                int studyId,
-                const Engines::MachineList& listOfMachines);
-  
-  SALOME_NamingService *_NS;
+  Engines::EngineComponent_ptr 
+  _FindComponent(const Engines::ContainerParameters& params,
+                 const char *componentName,
+                 const Engines::ResourceList& listOfResources);
+
+  Engines::EngineComponent_ptr
+  _LoadComponent(const Engines::ContainerParameters& params,
+                 const char *componentName);
+
+  SALOME_NamingService_Abstract *_NS;
+  SALOME_NamingService_Abstract *_NSnew;
   Engines::ContainerManager_var _ContManager;
   Engines::ResourcesManager_var _ResManager;
   
 } ;
 
+class LIFECYCLECORBA_EXPORT SALOME_LifeCycleCORBASSL : public SALOME_LifeCycleCORBA
+{
+public:
+  SALOME_LifeCycleCORBASSL();
+};
+
 #endif