General KERNEL Documentation     End User KERNEL Services  


src/Container/SALOME_ContainerManager.hxx

Go to the documentation of this file.
00001 // Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00002 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
00003 // 
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of the GNU Lesser General Public
00006 // License as published by the Free Software Foundation; either 
00007 // version 2.1 of the License.
00008 // 
00009 // This library is distributed in the hope that it will be useful 
00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 
00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00012 // Lesser General Public License for more details.
00013 //
00014 // You should have received a copy of the GNU Lesser General Public  
00015 // License along with this library; if not, write to the Free Software 
00016 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00017 //
00018 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00019 //
00020 #ifndef __SALOME_CONTAINERMANAGER_HXX__
00021 #define __SALOME_CONTAINERMANAGER_HXX__
00022 
00023 #include <SALOMEconfig.h>
00024 #include CORBA_CLIENT_HEADER(SALOME_Component)
00025 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
00026 #include "SALOME_ResourcesManager.hxx"
00027 #include "SALOME_LoadRateManager.hxx"
00028 
00029 #include <string>
00030 
00031 class SALOME_NamingService;
00032 
00033 #if defined CONTAINER_EXPORTS
00034 #if defined WIN32
00035 #define CONTAINER_EXPORT __declspec( dllexport )
00036 #else
00037 #define CONTAINER_EXPORT
00038 #endif
00039 #else
00040 #if defined WNT
00041 #define CONTAINER_EXPORT __declspec( dllimport )
00042 #else
00043 #define CONTAINER_EXPORT
00044 #endif
00045 #endif
00046 
00047 class CONTAINER_EXPORT SALOME_ContainerManager:
00048   public POA_Engines::ContainerManager,
00049   public PortableServer::RefCountServantBase
00050 {
00051 
00052 public:
00053   SALOME_ContainerManager(CORBA::ORB_ptr orb);
00054   ~SALOME_ContainerManager();
00055 
00056   Engines::Container_ptr
00057   FindOrStartContainer(const Engines::MachineParameters& params,
00058                  const Engines::MachineList& possibleComputer);
00059 
00060   Engines::MachineList *
00061   GetFittingResources(const Engines::MachineParameters& params,
00062                 const char *componentName);
00063 
00064   char* FindBest(const Engines::MachineList& possibleComputers);
00065 
00066   void Shutdown();
00067   void ShutdownContainers();
00068 
00069   static const char *_ContainerManagerNameInNS;
00070 
00071 protected:
00072   Engines::Container_ptr
00073   FindContainer(const Engines::MachineParameters& params,
00074           const Engines::MachineList& possibleComputers);
00075 
00076   Engines::Container_ptr
00077   FindContainer(const Engines::MachineParameters& params,
00078           const char *theMachine);
00079 
00080   long GetIdForContainer(void);
00081   long _id;
00082 
00083   SALOME_ResourcesManager *_ResManager;
00084   SALOME_NamingService *_NS;
00085 };
00086 
00087 #endif