Salome HOME
NRI : Add Loader.
[modules/kernel.git] / src / Container / SALOME_Container_i.hxx
1 //=============================================================================
2 // File      : SALOME_Container_i.hxx
3 // Created   : jeu jui 12 08:04:44 CEST 2001
4 // Author    : Paul RASCLE, EDF - MARC TAJCHMAN, CEA
5 // Project   : SALOME
6 // Copyright : EDF 2001 - CEA 2001
7 // $Header$
8 //=============================================================================
9
10 #ifndef _SALOME_CONTAINER_I_HXX_
11 #define _SALOME_CONTAINER_I_HXX_
12
13 #include <iostream.h>
14 #include <signal.h>
15 #include <stdlib.h>
16 #include <unistd.h>
17 #include <sys/types.h>
18 #include <SALOMEconfig.h>
19 #include CORBA_SERVER_HEADER(SALOME_Component)
20 #include <omnithread.h>
21 #include <map>
22 #include <string>
23
24 class SALOME_NamingService;
25
26 class Engines_Container_i: public POA_Engines::Container,
27                 public PortableServer::RefCountServantBase
28 {
29 public:
30   Engines_Container_i();
31   Engines_Container_i(CORBA::ORB_ptr orb, 
32                       PortableServer::POA_ptr poa,
33                       char * containerName ,
34                       int argc, char* argv[]);
35 // Constructeur pour composant parallele : ne pas faire appel au naming service
36   Engines_Container_i(CORBA::ORB_ptr orb, 
37                       PortableServer::POA_ptr poa,
38                       char * containerName,
39                       int flag);
40   virtual ~Engines_Container_i();
41
42
43   Engines::Container_ptr start_impl(const char* ContainerName);
44
45   Engines::Component_ptr load_impl(const char* nameToRegister,
46                                    const char* componentName);
47   void remove_impl(Engines::Component_ptr component_i);
48   void finalize_removal();
49
50   char* name();
51   char* machineName();
52   void ping();
53   bool Kill_impl() ;
54
55 protected:
56
57   SALOME_NamingService *_NS ;
58   string _library_path;
59   string _containerName;
60   CORBA::ORB_var _orb;
61   PortableServer::POA_var _poa;
62   PortableServer::ObjectId * _id ;
63   int _numInstance ;
64   map<string, void *> handle_map ;
65   map<string, void *> remove_map ;
66   omni_mutex _numInstanceMutex ; // if several threads on the same object
67
68 private: 
69
70   int   _argc ;
71   char** _argv ;
72
73 };
74
75 #endif
76