General KERNEL Documentation     End User KERNEL Services  


src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx

Go to the documentation of this file.
00001 //  SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++
00002 //
00003 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
00004 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
00005 // 
00006 //  This library is free software; you can redistribute it and/or 
00007 //  modify it under the terms of the GNU Lesser General Public 
00008 //  License as published by the Free Software Foundation; either 
00009 //  version 2.1 of the License. 
00010 // 
00011 //  This library is distributed in the hope that it will be useful, 
00012 //  but WITHOUT ANY WARRANTY; without even the implied warranty of 
00013 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
00014 //  Lesser General Public License for more details. 
00015 // 
00016 //  You should have received a copy of the GNU Lesser General Public 
00017 //  License along with this library; if not, write to the Free Software 
00018 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
00019 // 
00020 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00021 //
00022 //
00023 //
00024 //  File   : SALOME_LifeCycleCORBA.hxx
00025 //  Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
00026 //  Module : SALOME
00027 //  $Header: /home/server/cvs/KERNEL/KERNEL_SRC/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx,v 1.12 2006/06/01 11:15:16 jfa Exp $
00028 
00029 #ifndef _SALOME_LIFECYCLECORBA_HXX_
00030 #define _SALOME_LIFECYCLECORBA_HXX_
00031 
00032 #include <stdlib.h>
00033 #ifndef WNT
00034 #include <unistd.h>
00035 #endif
00036 #include <string>
00037 
00038 #include <SALOMEconfig.h>
00039 #include <Utils_SALOME_Exception.hxx>
00040 #include CORBA_CLIENT_HEADER(SALOME_ContainerManager)
00041 #include CORBA_CLIENT_HEADER(SALOME_Component)
00042 
00043 #if defined LIFECYCLECORBA_EXPORTS
00044 #if defined WIN32
00045 #define LIFECYCLECORBA_EXPORT __declspec( dllexport )
00046 #else
00047 #define LIFECYCLECORBA_EXPORT
00048 #endif
00049 #else
00050 #if defined WNT
00051 #define LIFECYCLECORBA_EXPORT __declspec( dllimport )
00052 #else
00053 #define LIFECYCLECORBA_EXPORT
00054 #endif
00055 #endif
00056 
00057 
00058 class SALOME_NamingService;
00059 
00060 class LIFECYCLECORBA_EXPORT IncompatibleComponent : public SALOME_Exception
00061 {
00062 public :
00063   IncompatibleComponent(void);
00064   IncompatibleComponent(const IncompatibleComponent &ex);
00065 };
00066 
00067 class LIFECYCLECORBA_EXPORT SALOME_LifeCycleCORBA
00068 {
00069 public:
00070   SALOME_LifeCycleCORBA(SALOME_NamingService *ns = 0);
00071   virtual ~SALOME_LifeCycleCORBA();
00072 
00073   Engines::Component_ptr 
00074   FindComponent(const Engines::MachineParameters& params,
00075           const char *componentName,
00076           int studyId=0);
00077 
00078   Engines::Component_ptr
00079   LoadComponent(const Engines::MachineParameters& params,
00080           const char *componentName,
00081           int studyId=0);
00082 
00083   Engines::Component_ptr 
00084   FindOrLoad_Component(const Engines::MachineParameters& params,
00085                  const char *componentName,
00086                  int studyId =0);
00087 
00088   Engines::Component_ptr
00089   FindOrLoad_Component(const char *containerName,
00090                  const char *componentName); // for compatibility
00091   
00092   bool isKnownComponentClass(const char *componentName);
00093 
00094   bool isMpiContainer(const Engines::MachineParameters& params)
00095     throw(IncompatibleComponent);
00096 
00097   int NbProc(const Engines::MachineParameters& params);
00098 
00099   void preSet(Engines::MachineParameters& params);
00100 
00101   Engines::ContainerManager_ptr getContainerManager();
00102 
00103 protected:
00104 
00110   Engines::Component_ptr 
00111   _FindComponent(const Engines::MachineParameters& params,
00112            const char *componentName,
00113            int studyId,
00114            const Engines::MachineList& listOfMachines);
00115 
00116   Engines::Component_ptr
00117   _LoadComponent(const Engines::MachineParameters& params,
00118            const char *componentName,
00119            int studyId,
00120            const Engines::MachineList& listOfMachines);
00121   
00122   SALOME_NamingService *_NS;
00123   Engines::ContainerManager_var _ContManager;
00124   
00125 } ;
00126 
00127 #endif