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)
43 #if defined LIFECYCLECORBA_EXPORTS
45 #define LIFECYCLECORBA_EXPORT __declspec( dllexport )
47 #define LIFECYCLECORBA_EXPORT
51 #define LIFECYCLECORBA_EXPORT __declspec( dllimport )
53 #define LIFECYCLECORBA_EXPORT
58 class SALOME_NamingService;
60 class LIFECYCLECORBA_EXPORT IncompatibleComponent : public SALOME_Exception
63 IncompatibleComponent(void);
64 IncompatibleComponent(const IncompatibleComponent &ex);
67 class LIFECYCLECORBA_EXPORT SALOME_LifeCycleCORBA
70 SALOME_LifeCycleCORBA(SALOME_NamingService *ns = 0);
71 virtual ~SALOME_LifeCycleCORBA();
73 Engines::Component_ptr
74 FindComponent(const Engines::MachineParameters& params,
75 const char *componentName,
78 Engines::Component_ptr
79 LoadComponent(const Engines::MachineParameters& params,
80 const char *componentName,
83 Engines::Component_ptr
84 FindOrLoad_Component(const Engines::MachineParameters& params,
85 const char *componentName,
88 Engines::Component_ptr
89 FindOrLoad_Component(const char *containerName,
90 const char *componentName); // for compatibility
92 bool isKnownComponentClass(const char *componentName);
94 bool isMpiContainer(const Engines::MachineParameters& params)
95 throw(IncompatibleComponent);
97 int NbProc(const Engines::MachineParameters& params);
99 void preSet(Engines::MachineParameters& params);
101 Engines::ContainerManager_ptr getContainerManager();
105 /*! Establish if a component called "componentName" in a container called
107 * exists among the list of resources in "listOfMachines".
108 * This method uses Naming Service to find the component.
110 Engines::Component_ptr
111 _FindComponent(const Engines::MachineParameters& params,
112 const char *componentName,
114 const Engines::MachineList& listOfMachines);
116 Engines::Component_ptr
117 _LoadComponent(const Engines::MachineParameters& params,
118 const char *componentName,
120 const Engines::MachineList& listOfMachines);
122 SALOME_NamingService *_NS;
123 Engines::ContainerManager_var _ContManager;