X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FLifeCycleCORBA%2FSALOME_LifeCycleCORBA.hxx;h=d5c0bb67ffd7e2635d82ca9431ab3601d474f620;hb=033997a343242f8a6a21ff245bfc07a627bb9aa0;hp=beeed25b0c4e6342d6736615ebaddfd1bc8b3716;hpb=4655b0b0eb5345da6a86852021014b0cbae2ad30;p=modules%2Fkernel.git diff --git a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx index beeed25b0..d5c0bb67f 100644 --- a/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx +++ b/src/LifeCycleCORBA/SALOME_LifeCycleCORBA.hxx @@ -1,50 +1,150 @@ -//============================================================================= -// File : SALOME_LifeCycleCORBA.hxx -// Created : jeu jui 12 14:55:45 CEST 2001 -// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA -// Project : SALOME -// Copyright : EDF 2001 -// $Header$ -//============================================================================= +// Copyright (C) 2007-2010 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +// SALOME LifeCycleCORBA : implementation of containers and engines life cycle both in Python and C++ +// File : SALOME_LifeCycleCORBA.hxx +// Author : Paul RASCLE, EDF - MARC TAJCHMAN, CEA +// Module : SALOME +// $Header$ +// #ifndef _SALOME_LIFECYCLECORBA_HXX_ #define _SALOME_LIFECYCLECORBA_HXX_ #include +#ifndef WIN32 #include +#endif #include #include +#include +#include CORBA_CLIENT_HEADER(SALOME_ContainerManager) #include CORBA_CLIENT_HEADER(SALOME_Component) +#include + +#ifdef WIN32 +# if defined LIFECYCLECORBA_EXPORTS || defined SalomeLifeCycleCORBA_EXPORTS +# define LIFECYCLECORBA_EXPORT __declspec( dllexport ) +# else +# define LIFECYCLECORBA_EXPORT __declspec( dllimport ) +# endif +#else +# define LIFECYCLECORBA_EXPORT +#endif + class SALOME_NamingService; -class SALOME_LifeCycleCORBA +class LIFECYCLECORBA_EXPORT IncompatibleComponent : public SALOME_Exception +{ +public : + IncompatibleComponent(void); + IncompatibleComponent(const IncompatibleComponent &ex); +}; + +class LIFECYCLECORBA_EXPORT SALOME_LifeCycleCORBA { public: - SALOME_LifeCycleCORBA(); - SALOME_LifeCycleCORBA(SALOME_NamingService *ns); + SALOME_LifeCycleCORBA(SALOME_NamingService *ns = 0); virtual ~SALOME_LifeCycleCORBA(); - Engines::Container_var FindContainer(const char *containerName); - Engines::Component_var FindOrLoad_Component(const char *containerName, - const char *componentName, - const char *implementationPath); - Engines::Component_var FindOrLoad_Component(const char *containerName, - const char *componentName); + Engines::Component_ptr + FindComponent(const Engines::MachineParameters& params, + const char *componentName, + int studyId=0); + + Engines::Component_ptr + LoadComponent(const Engines::MachineParameters& params, + const char *componentName, + int studyId=0); + + Engines::Component_ptr + FindOrLoad_Component(const Engines::MachineParameters& params, + const char *componentName, + int studyId =0); + + // SALOME 6 - Interface + Engines::Component_ptr + FindOrLoad_Component(const Engines::ContainerParameters& params, + const char *componentName, + int studyId =0); + + Engines::Component_ptr + FindOrLoad_Component(const char *containerName, + const char *componentName); // for compatibility + + // Parallel extension + Engines::Component_ptr + Load_ParallelComponent(const Engines::ContainerParameters& params, + const char *componentName, + int studyId); + + bool isKnownComponentClass(const char *componentName); + + bool isMpiContainer(const Engines::ContainerParameters& params) + throw(IncompatibleComponent); + + int NbProc(const Engines::ContainerParameters& params); + + static void preSet(Engines::MachineParameters& outparams); + static void preSet(Engines::ResourceParameters& outparams); + static void preSet(Engines::ContainerParameters& outparams); + + Engines::ContainerManager_ptr getContainerManager(); + Engines::ResourcesManager_ptr getResourcesManager(); + SALOME_NamingService * namingService(); + CORBA::ORB_ptr orb(); + void copyFile(const char* hostSrc, const char* fileSrc, const char* hostDest, const char* fileDest); + + void shutdownServers(); + static void killOmniNames(); + + // For SALOME 5.1.x + // Will be deleted on SALOME 6 + void convert(const Engines::MachineParameters& params_in, + Engines::ContainerParameters& params_out); protected: - SALOME_NamingService *_NS; - Engines::Container_var _FactoryServer ; -private: - string ContainerName( const char * aComputerContainer , - string * theComputer , - string * theContainer ) ; - string ComputerPath( const char * theComputer ) ; - Engines::Container_var FindOrStartContainer(const string aComputerContainer , - const string theComputer , - const string theContainer ) ; + /*! Establish if a component called "componentName" in a container called + * "containerName" + * exists among the list of resources in "listOfMachines". + * This method uses Naming Service to find the component. + */ + Engines::Component_ptr + _FindComponent(const Engines::ContainerParameters& params, + const char *componentName, + int studyId, + const Engines::ResourceList& listOfResources); + Engines::Component_ptr + _LoadComponent(const Engines::ContainerParameters& params, + const char *componentName, + int studyId); + + SALOME_NamingService *_NS; + SALOME_NamingService *_NSnew; + Engines::ContainerManager_var _ContManager; + Engines::ResourcesManager_var _ResManager; + } ; #endif