1 // Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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, or (at your option) any later version.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef _SALOME_PCONTAINER_
24 #define _SALOME_PCONTAINER_
26 #include <SALOMEconfig.h>
27 #include CORBA_SERVER_HEADER(SALOME_MPIContainer)
28 #include "SALOME_Container_i.hxx"
29 #include "MPIObject_i.hxx"
31 void * th_loadcomponentlibrary(void *st);
32 void * th_createcomponentinstance(void *st);
33 void * th_loadimpl(void *st);
34 void * th_removeimpl(void *st);
35 void * th_finalizeremoval(void *st);
39 Engines::IORTab* tior;
40 std::string compoName;
41 std::string nameToRegister;
42 Engines::EngineComponent_ptr cptr;
45 class Engines_MPIContainer_i : public POA_Engines::MPIContainer,
46 public Engines_Container_i,
52 Engines_MPIContainer_i( CORBA::ORB_ptr orb,
53 PortableServer::POA_ptr poa,
55 int argc, char *argv[]);
56 Engines_MPIContainer_i();
58 ~Engines_MPIContainer_i();
60 // shutdown corba server
63 // Load a component library
64 // synchronous version for process 0
65 bool load_component_Library(const char* componentName, CORBA::String_out reason);
67 // Create an instance of component
68 // synchronous version for process 0
69 virtual Engines::EngineComponent_ptr
70 create_component_instance_env( const char* componentName,
71 const Engines::FieldsDict& env,
72 CORBA::String_out reason);
74 // Load a component in current MPI container
75 // synchronous version for process 0
76 Engines::EngineComponent_ptr load_impl(const char* nameToRegister,
77 const char* componentName);
79 // Unload a component from current MPI container
80 // synchronous version for process 0
81 void remove_impl(Engines::EngineComponent_ptr component_i);
83 // synchronous version for process 0
84 void finalize_removal();
87 bool Lload_component_Library(const char* componentName);
88 Engines::EngineComponent_ptr
89 Lcreate_component_instance(const char* componentName);
90 Engines::EngineComponent_ptr Lload_impl(const char* nameToRegister,
91 const char* componentName);
93 Engines::EngineComponent_ptr
94 createMPIInstance(std::string genericRegisterName,