Version: 9.16.0
MPIContainer_i.hxx
Go to the documentation of this file.
1// Copyright (C) 2007-2026 CEA, EDF, OPEN CASCADE
2//
3// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5//
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.
10//
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.
15//
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
19//
20// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21//
22
23#ifndef _SALOME_PCONTAINER_
24#define _SALOME_PCONTAINER_
25
26#include <SALOMEconfig.h>
27#include CORBA_SERVER_HEADER(SALOME_MPIContainer)
29#include "MPIObject_i.hxx"
30
31void * th_loadcomponentlibrary(void *st);
32void * th_createcomponentinstance(void *st);
33void * th_loadimpl(void *st);
34void * th_removeimpl(void *st);
35void * th_finalizeremoval(void *st);
36
37typedef struct {
38 int ip;
40 std::string compoName;
41 std::string nameToRegister;
42 Engines::EngineComponent_ptr cptr;
43} thread_st;
44
45class Engines_MPIContainer_i : public POA_Engines::MPIContainer,
47 public MPIObject_i
48{
49
50 public:
51 // Constructor
52 Engines_MPIContainer_i( CORBA::ORB_ptr orb,
53 PortableServer::POA_ptr poa,
54 char * containerName,
55 int argc, char *argv[]);
57 // Destructor
59
60 // shutdown corba server
61 void Shutdown();
62
63 // Load a component library
64 // synchronous version for process 0
65 bool load_component_Library(const char* componentName, CORBA::String_out reason);
66
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);
73
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);
78
79 // Unload a component from current MPI container
80 // synchronous version for process 0
81 void remove_impl(Engines::EngineComponent_ptr component_i);
82
83 // synchronous version for process 0
84 void finalize_removal();
85
86 private:
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);
92
93 Engines::EngineComponent_ptr
94 createMPIInstance(std::string genericRegisterName,
95 void *handle);
96
97};
98#endif
void * th_createcomponentinstance(void *st)
Definition: MPIContainer_i.cxx:597
void * th_finalizeremoval(void *st)
Definition: MPIContainer_i.cxx:618
void * th_loadimpl(void *st)
Definition: MPIContainer_i.cxx:604
void * th_loadcomponentlibrary(void *st)
Definition: MPIContainer_i.cxx:588
void * th_removeimpl(void *st)
Definition: MPIContainer_i.cxx:611
C++ implementation of Engines::Container interface.
Definition: SALOME_Container_i.hxx:244
Definition: MPIContainer_i.hxx:48
bool load_component_Library(const char *componentName, CORBA::String_out reason)
load a component implementation
Definition: MPIContainer_i.cxx:119
~Engines_MPIContainer_i()
Definition: MPIContainer_i.cxx:80
virtual Engines::EngineComponent_ptr create_component_instance_env(const char *componentName, const Engines::FieldsDict &env, CORBA::String_out reason)
Create a new component instance with environment variables specified.
Definition: MPIContainer_i.cxx:223
Engines::EngineComponent_ptr Lcreate_component_instance(const char *componentName)
Definition: MPIContainer_i.cxx:253
Engines::EngineComponent_ptr createMPIInstance(std::string genericRegisterName, void *handle)
Definition: MPIContainer_i.cxx:323
void Shutdown()
Definition: MPIContainer_i.cxx:86
Engines_MPIContainer_i()
Definition: MPIContainer_i.cxx:75
Engines::EngineComponent_ptr Lload_impl(const char *nameToRegister, const char *componentName)
Definition: MPIContainer_i.cxx:430
bool Lload_component_Library(const char *componentName)
Definition: MPIContainer_i.cxx:145
Engines::EngineComponent_ptr load_impl(const char *nameToRegister, const char *componentName)
Definition: MPIContainer_i.cxx:402
void finalize_removal()
Definition: MPIContainer_i.cxx:550
void remove_impl(Engines::EngineComponent_ptr component_i)
Definition: MPIContainer_i.cxx:513
Definition: MPIObject_i.hxx:33
sequence< KeyValuePair > FieldsDict
Definition: SALOME_Component.idl:65
sequence< Object > IORTab
Definition: SALOME_MPIObject.idl:33
poa
Definition: SALOME_ContainerPy.py:377
containerName
Definition: SALOME_ContainerPy.py:383
string st
Definition: TestSalomeSDS1.py:29
argv
Definition: envSalome.py:42
orb
Definition: salome.py:122
Definition: MPIContainer_i.hxx:37
Engines::EngineComponent_ptr cptr
Definition: MPIContainer_i.hxx:42
int ip
Definition: MPIContainer_i.hxx:38
Engines::IORTab * tior
Definition: MPIContainer_i.hxx:39
std::string compoName
Definition: MPIContainer_i.hxx:40
std::string nameToRegister
Definition: MPIContainer_i.hxx:41