1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
23 // File : SALOME_LifeCycleCORBA.hxx
24 // Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
28 #ifndef _SALOME_LIFECYCLECORBA_HXX_
29 #define _SALOME_LIFECYCLECORBA_HXX_
37 #include <SALOMEconfig.h>
38 #include <Utils_SALOME_Exception.hxx>
39 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
40 #include CORBA_CLIENT_HEADER(SALOME_Component)
44 # if defined LIFECYCLECORBA_EXPORTS || defined SalomeLifeCycleCORBA_EXPORTS
45 # define LIFECYCLECORBA_EXPORT __declspec( dllexport )
47 # define LIFECYCLECORBA_EXPORT __declspec( dllimport )
50 # define LIFECYCLECORBA_EXPORT
54 class SALOME_NamingService;
56 class LIFECYCLECORBA_EXPORT IncompatibleComponent : public SALOME_Exception
59 IncompatibleComponent(void);
60 IncompatibleComponent(const IncompatibleComponent &ex);
63 class LIFECYCLECORBA_EXPORT SALOME_LifeCycleCORBA
66 SALOME_LifeCycleCORBA(SALOME_NamingService *ns = 0);
67 virtual ~SALOME_LifeCycleCORBA();
69 Engines::Component_ptr
70 FindComponent(const Engines::MachineParameters& params,
71 const char *componentName,
74 Engines::Component_ptr
75 LoadComponent(const Engines::MachineParameters& params,
76 const char *componentName,
79 Engines::Component_ptr
80 FindOrLoad_Component(const Engines::MachineParameters& params,
81 const char *componentName,
84 Engines::Component_ptr
85 FindOrLoad_Component(const char *containerName,
86 const char *componentName); // for compatibility
89 Engines::Component_ptr
90 Load_ParallelComponent(const Engines::MachineParameters& params,
91 const char *componentName,
94 bool isKnownComponentClass(const char *componentName);
96 bool isMpiContainer(const Engines::MachineParameters& params)
97 throw(IncompatibleComponent);
99 int NbProc(const Engines::MachineParameters& params);
101 void preSet(Engines::MachineParameters& params);
103 Engines::ContainerManager_ptr getContainerManager();
104 Engines::ResourcesManager_ptr getResourcesManager();
106 void shutdownServers();
107 static void killOmniNames();
111 /*! Establish if a component called "componentName" in a container called
113 * exists among the list of resources in "listOfMachines".
114 * This method uses Naming Service to find the component.
116 Engines::Component_ptr
117 _FindComponent(const Engines::MachineParameters& params,
118 const char *componentName,
120 const Engines::MachineList& listOfMachines);
122 Engines::Component_ptr
123 _LoadComponent(const Engines::MachineParameters& params,
124 const char *componentName,
126 const Engines::MachineList& listOfMachines);
128 SALOME_NamingService *_NS;
129 Engines::ContainerManager_var _ContManager;
130 Engines::ResourcesManager_var _ResManager;