]> SALOME platform Git repositories - modules/kernel.git/blob - src/MPIContainer/MPIContainer_i.hxx
Salome HOME
Test EXPORTS definition with target name as suggested by cmake
[modules/kernel.git] / src / MPIContainer / MPIContainer_i.hxx
1 //  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, 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.
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 //  SALOME MPIContainer : implemenation of container based on MPI libraries
23 //  File   : MPIContainer_i.hxx
24 //  Module : SALOME
25 //
26 #ifndef _SALOME_PCONTAINER_
27 #define _SALOME_PCONTAINER_ 
28
29 #include <SALOMEconfig.h>
30 #include CORBA_SERVER_HEADER(SALOME_MPIContainer)
31 #include "SALOME_Container_i.hxx"
32 #include "MPIObject_i.hxx"
33
34 class Engines_MPIContainer_i : public POA_Engines::MPIContainer,
35                                public Engines_Container_i,
36                                public MPIObject_i
37 {
38
39  public:
40   // Constructor
41   Engines_MPIContainer_i( int nbproc, int numproc,
42                           CORBA::ORB_ptr orb,
43                           PortableServer::POA_ptr poa,
44                           char * containerName,
45                           int argc, char *argv[]);
46   Engines_MPIContainer_i(int nbproc, int numproc);
47   // Destructor
48   ~Engines_MPIContainer_i();
49
50   // shutdown corba server
51   void Shutdown();
52
53   // Load a component library
54   // synchronous version for process 0
55   bool load_component_Library(const char* componentName);
56   // asynchronous version for other process
57   void Asload_component_Library(const char* componentName);
58
59   // Create an instance of component
60   // synchronous version for process 0
61   Engines::Component_ptr
62   create_component_instance( const char* componentName,
63                              CORBA::Long studyId); // 0 for multiStudy
64   // asynchronous version for other process
65   void Ascreate_component_instance( const char* componentName,
66                                   CORBA::Long studyId); // 0 for multiStudy
67
68   // Load a component in current MPI container
69   // synchronous version for process 0
70   Engines::Component_ptr load_impl(const char* nameToRegister,
71                                    const char* componentName);
72   // asynchronous version for other process
73   void Asload_impl(const char* nameToRegister, const char* componentName);
74
75   // Unload a component from current MPI container
76   // synchronous version for process 0
77   void remove_impl(Engines::Component_ptr component_i);
78   // asynchronous version for other process
79   void Asremove_impl(Engines::Component_ptr component_i);
80
81   // synchronous version for process 0
82   void finalize_removal();
83   // asynchronous version for other process
84   void Asfinalize_removal();
85
86  private:
87   // local version to not duplicate code 
88   // called by synchronous and asynchronous version
89   bool Lload_component_Library(const char* componentName);
90   Engines::Component_ptr
91   Lcreate_component_instance( const char* componentName,
92                               CORBA::Long studyId); // 0 for multiStudy
93   Engines::Component_ptr Lload_impl(const char* nameToRegister,
94                                     const char* componentName);
95   void Lremove_impl(Engines::Component_ptr component_i);
96   void Lfinalize_removal();
97
98   Engines::Component_ptr
99   createMPIInstance(std::string genericRegisterName,
100                     void *handle,
101                     int studyId);
102
103 };
104 #endif