Salome HOME
249d4c0aa82e2268be516d3d0c74a746db4face2
[modules/kernel.git] / src / LifeCycleCORBA / SALOME_LifeCycleCORBA.hxx
1 //  SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : SALOME_LifeCycleCORBA.hxx
25 //  Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef _SALOME_LIFECYCLECORBA_HXX_
30 #define _SALOME_LIFECYCLECORBA_HXX_
31
32 #include <stdlib.h>
33 #include <unistd.h>
34 #include <string>
35
36 #include <SALOMEconfig.h>
37 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
38 #include CORBA_CLIENT_HEADER(SALOME_Component)
39
40 class SALOME_NamingService;
41
42 class SALOME_LifeCycleCORBA
43 {
44 public:
45   SALOME_LifeCycleCORBA(SALOME_NamingService *ns);
46   virtual ~SALOME_LifeCycleCORBA();
47   Engines::Component_ptr FindOrLoad_Component(const Engines::MachineParameters& params,
48                                               const char *componentName);
49   Engines::Component_ptr FindOrLoad_Component(const char *containerName,
50                                               const char *componentName);
51   bool isKnownComponentClass(const char *componentName);
52 protected:
53   //! Establish if a component called "componentName" in a container called "containerName" exists among the list of resources
54   //! in "listOfMachines". This method uses Naming Service to find the component.
55   Engines::Component_ptr FindComponent(const char *containerName,
56                                             const char *componentName,
57                                             const Engines::MachineList& listOfMachines);
58
59   Engines::Component_ptr LoadComponent(const char *containerName, const char *componentName, const Engines::MachineList& listOfMachines);
60
61   SALOME_NamingService *_NS;
62   Engines::ContainerManager_var _ContManager;
63   
64   //private:
65   std::string ContainerName( const char * aComputerContainer ,
66                              std::string * theComputer ,
67                              std::string * theContainer ) ;
68   std::string ComputerPath( const char * theComputer ) ;
69 } ;
70
71 #endif