Salome HOME
b57a53005c3f6bc921c51f0f71331282ba7453eb
[modules/kernel.git] / src / Container / SALOME_Component_i.hxx
1 //=============================================================================
2 // File      : SALOME_Component_i.hxx
3 // Created   : jeu jui 12 08:04:40 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_COMPONENT_I_HXX_
11 #define _SALOME_COMPONENT_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 <string>
19 #include <SALOMEconfig.h>
20 #include CORBA_SERVER_HEADER(SALOME_Component)
21 #include "NOTIFICATION.hxx"
22
23 class RegistryConnexion;
24
25 class Engines_Component_i: public virtual POA_Engines::Component,
26                            public virtual PortableServer::RefCountServantBase
27 {
28 public:
29   Engines_Component_i();
30   Engines_Component_i(CORBA::ORB_ptr orb,
31                       PortableServer::POA_ptr poa,
32                       PortableServer::ObjectId * contId, 
33                       const char *instanceName, 
34                       const char *interfaceName,
35                       bool notif = false);
36   // Consructeur pour composant parallele: ne pas faire appel au registry
37   Engines_Component_i(CORBA::ORB_ptr orb,
38                       PortableServer::POA_ptr poa,
39                       PortableServer::ObjectId * contId, 
40                       const char *instanceName, 
41                       const char *interfaceName,
42                       int flag,
43                       bool notif = false);
44
45   virtual ~Engines_Component_i();
46
47   char* instanceName();
48   char* interfaceName();
49
50   void destroy();
51   void ping();
52
53   Engines::Container_ptr GetContainerRef();
54   PortableServer::ObjectId * getId(); 
55
56   void beginService(const char *serviceName);
57   void endService(const char *serviceName);
58   void sendMessage(const char *event_type, const char *message);
59
60   void Names( const char * graphName , const char * nodeName ) ;
61   char * graphName() ;
62   char * nodeName() ;
63   bool Kill_impl();
64   bool Stop_impl();
65   bool Suspend_impl();
66   bool Resume_impl();
67
68 protected:
69   string _instanceName ;
70   string _interfaceName ;
71   string _serviceName ;
72   string _graphName ;
73   string _nodeName ;
74   CORBA::ORB_ptr _orb;
75   PortableServer::POA_ptr _poa;
76   PortableServer::ObjectId * _id;
77   PortableServer::ObjectId * _contId;
78   Engines_Component_i * _thisObj ;
79   RegistryConnexion *_myConnexionToRegistry;
80   NOTIFICATION_Supplier* _notifSupplier;
81
82 private:
83   pthread_t _ThreadId ;
84 };
85
86 #endif