Salome HOME
PR: merge from branch BR_3_1_0deb tag mergeto_trunk_22dec05
[modules/kernel.git] / src / Container / SALOME_ContainerManager.hxx
1 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
2 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
3 // 
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either 
7 // version 2.1 of the License.
8 // 
9 // This library is distributed in the hope that it will be useful 
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
12 // Lesser General Public License for more details.
13 //
14 // You should have received a copy of the GNU Lesser General Public  
15 // License along with this library; if not, write to the Free Software 
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
17 //
18 // See http://www.salome-platform.org/
19 //
20 #ifndef __SALOME_CONTAINERMANAGER_HXX__
21 #define __SALOME_CONTAINERMANAGER_HXX__
22
23 #include <SALOMEconfig.h>
24 #include CORBA_CLIENT_HEADER(SALOME_Component)
25 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
26 #include "SALOME_ResourcesManager.hxx"
27 #include "SALOME_LoadRateManager.hxx"
28
29 #include <string>
30
31 class SALOME_NamingService;
32
33 #if defined CONTAINER_EXPORTS
34 #if defined WIN32
35 #define CONTAINER_EXPORT __declspec( dllexport )
36 #else
37 #define CONTAINER_EXPORT
38 #endif
39 #else
40 #if defined WNT
41 #define CONTAINER_EXPORT __declspec( dllimport )
42 #else
43 #define CONTAINER_EXPORT
44 #endif
45 #endif
46
47 class CONTAINER_EXPORT SALOME_ContainerManager:
48   public POA_Engines::ContainerManager,
49   public PortableServer::RefCountServantBase
50 {
51
52 public:
53   SALOME_ContainerManager(CORBA::ORB_ptr orb);
54   ~SALOME_ContainerManager();
55
56   Engines::Container_ptr
57   FindOrStartContainer(const Engines::MachineParameters& params,
58                        const Engines::MachineList& possibleComputer);
59
60   Engines::MachineList *
61   GetFittingResources(const Engines::MachineParameters& params,
62                       const char *componentName);
63
64   char* FindBest(const Engines::MachineList& possibleComputers);
65
66   void Shutdown();
67   void ShutdownContainers();
68
69   static const char *_ContainerManagerNameInNS;
70
71 protected:
72   Engines::Container_ptr
73   FindContainer(const Engines::MachineParameters& params,
74                 const Engines::MachineList& possibleComputers);
75
76   Engines::Container_ptr
77   FindContainer(const Engines::MachineParameters& params,
78                 const char *theMachine);
79
80   long GetIdForContainer(void);
81   long _id;
82
83   SALOME_ResourcesManager *_ResManager;
84   SALOME_NamingService *_NS;
85 };
86
87 #endif