1 // SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
3 // Copyright (C) 2003 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
24 // File : SALOME_LifeCycleCORBA.hxx
25 // Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
29 #ifndef _SALOME_LIFECYCLECORBA_HXX_
30 #define _SALOME_LIFECYCLECORBA_HXX_
38 #include <SALOMEconfig.h>
39 #include <Utils_SALOME_Exception.hxx>
40 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
41 #include CORBA_CLIENT_HEADER(SALOME_Component)
45 # if defined LIFECYCLECORBA_EXPORTS
46 # define LIFECYCLECORBA_EXPORT __declspec( dllexport )
48 # define LIFECYCLECORBA_EXPORT __declspec( dllimport )
51 # define LIFECYCLECORBA_EXPORT
55 class SALOME_NamingService;
57 class LIFECYCLECORBA_EXPORT IncompatibleComponent : public SALOME_Exception
60 IncompatibleComponent(void);
61 IncompatibleComponent(const IncompatibleComponent &ex);
64 class LIFECYCLECORBA_EXPORT SALOME_LifeCycleCORBA
67 SALOME_LifeCycleCORBA(SALOME_NamingService *ns = 0);
68 virtual ~SALOME_LifeCycleCORBA();
70 Engines::Component_ptr
71 FindComponent(const Engines::MachineParameters& params,
72 const char *componentName,
75 Engines::Component_ptr
76 LoadComponent(const Engines::MachineParameters& params,
77 const char *componentName,
80 Engines::Component_ptr
81 FindOrLoad_Component(const Engines::MachineParameters& params,
82 const char *componentName,
85 Engines::Component_ptr
86 FindOrLoad_Component(const char *containerName,
87 const char *componentName); // for compatibility
90 Engines::Component_ptr
91 Load_ParallelComponent(const Engines::MachineParameters& params,
92 const char *componentName,
95 bool isKnownComponentClass(const char *componentName);
97 bool isMpiContainer(const Engines::MachineParameters& params)
98 throw(IncompatibleComponent);
100 int NbProc(const Engines::MachineParameters& params);
102 void preSet(Engines::MachineParameters& params);
104 Engines::ContainerManager_ptr getContainerManager();
105 Engines::ResourcesManager_ptr getResourcesManager();
109 /*! Establish if a component called "componentName" in a container called
111 * exists among the list of resources in "listOfMachines".
112 * This method uses Naming Service to find the component.
114 Engines::Component_ptr
115 _FindComponent(const Engines::MachineParameters& params,
116 const char *componentName,
118 const Engines::MachineList& listOfMachines);
120 Engines::Component_ptr
121 _LoadComponent(const Engines::MachineParameters& params,
122 const char *componentName,
124 const Engines::MachineList& listOfMachines);
126 SALOME_NamingService *_NS;
127 Engines::ContainerManager_var _ContManager;
128 Engines::ResourcesManager_var _ResManager;