1 // Copyright (C) 2007-2012 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 // SALOME Registry : Registry server implementation
24 // File : RegistryService.hxx
25 // Author : Pascale NOYRET - Antoine YESSAYAN, EDF
29 # ifndef __RegistryService_h__
30 # define __RegistryService_h__
32 #include "SALOME_Registry.hxx"
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SALOME_Registry)
40 #pragma warning(disable:4275) // Disable warning interface non dll
41 #pragma warning(disable:4251) // Warning DLL Interface ...
44 class REGISTRY_EXPORT RegistryService : public POA_Registry::Components //, public PortableServer::RefCountServantBase
48 enum Status { UNDEF=-1 , TERMINATED=0 , RUNNING=1 } ;
53 const char* const _ior;
54 const char* const _name;
56 const char* const _machine;
57 const char* const _adip;
59 const char* const _pwname;
60 const long _ts_start ;
62 const char* const _cdir ;
67 friend class RegistryService ;
69 client_infos( const Registry::Infos &infos );
76 RegistryService(void);
77 virtual ~RegistryService(void);
81 virtual CORBA::ULong add (const Registry::Infos & infos);
82 virtual CORBA::ULong size ( void );
84 virtual void remove( const CORBA::ULong id );
85 virtual void hello( const CORBA::ULong id );
87 virtual void remove( CORBA::ULong id );
88 virtual void hello( CORBA::ULong id );
90 virtual void end(void);
92 virtual Registry::AllInfos *getall(void);
93 virtual Registry::AllInfos *history(void);
95 void SessionName( const char *sessionName ) ;
97 void SetOrb( CORBA::ORB_ptr orb ) { _orb = CORBA::ORB::_duplicate(orb); return; }
99 void Shutdown() { if(!CORBA::is_nil(_orb)) _orb->shutdown(0); }
104 const char *_SessionName ;
106 std::map<int,client_infos *> _reg ;
107 std::map<int,client_infos *> _fin ;
109 Registry::AllInfos* makeseq(std::map<int,client_infos *> &mymap );