Salome HOME
Initialisation de la base KERNEL avec la version operationnelle de KERNEL_SRC issue...
[modules/kernel.git] / src / Registry / RegistryService.hxx
1 //=============================================================================
2 // File      : RegistryService.hxx
3 // Created   : Mon Nov  5 17:26:23 CET 2001
4 // Author    : Pascale NOYRET - Antoine YESSAYAN, EDF
5 // Project   : SALOME
6 // Copyright : EDF 2001
7 // $Header$
8 //=============================================================================
9
10 # ifndef __RegistryService_h__
11 # define __RegistryService_h__
12
13 #include <SALOMEconfig.h>
14 #include CORBA_SERVER_HEADER(SALOME_Registry)
15
16 # include <map>
17
18
19 class RegistryService : public POA_Registry::Components  //, public PortableServer::RefCountServantBase
20 {
21
22 public :
23         enum Status { UNDEF=-1 , TERMINATED=0 , RUNNING=1 } ;
24
25         class client_infos
26         {
27         protected :
28                 const char* const       _ior;
29                 const char* const       _name;
30                 const long              _pid ;
31                 const char* const       _machine;
32                 const char* const       _adip;
33                 const long              _uid;
34                 const char* const       _pwname;
35                 const long              _ts_start ;
36                 const long              _difftime;
37                 const char* const       _cdir ;
38                       long              _ts_hello ;
39                       long              _ts_end ;
40                       Status            _status;
41         public :
42                 friend class RegistryService ;
43
44                 client_infos( const Registry::Infos &infos );
45                 ~client_infos();
46         }; 
47
48
49
50 public :
51         RegistryService(void);
52         virtual ~RegistryService(void);
53
54         void ping();
55         virtual CORBA::ULong add (const Registry::Infos & infos);
56         virtual CORBA::ULong size ( void );
57         virtual void remove( const CORBA::ULong id );
58         virtual void hello( const CORBA::ULong id );
59         virtual void end(void);
60
61         virtual Registry::AllInfos *getall(void);
62         virtual Registry::AllInfos *history(void);
63
64         void SessionName( const char *sessionName ) ;
65
66
67 protected :
68
69         const char              *_SessionName ;
70         int                      _Compteur ;
71         map<int,client_infos *>  _reg ;
72         map<int,client_infos *>  _fin ;
73
74         Registry::AllInfos* makeseq(map<int,client_infos *> &mymap );
75
76 } ;
77
78 # endif