Salome HOME
PR: merge from tag mergeto_trunk_20Jan05
[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 protected:
52   //! Establish if a component called "componentName" in a container called "containerName" exists among the list of resources
53   //! in "listOfMachines". This method uses Naming Service to find the component.
54   Engines::Component_ptr FindComponent(const char *containerName,
55                                             const char *componentName,
56                                             const Engines::MachineList& listOfMachines);
57
58   Engines::Component_ptr LoadComponent(const char *containerName, const char *componentName, const Engines::MachineList& listOfMachines);
59
60   SALOME_NamingService *_NS;
61   Engines::ContainerManager_var _ContManager;
62   
63   //private:
64   std::string ContainerName( const char * aComputerContainer ,
65                              std::string * theComputer ,
66                              std::string * theContainer ) ;
67   std::string ComputerPath( const char * theComputer ) ;
68 } ;
69
70 #endif