Salome HOME
Fix compilation pb.
[modules/kernel.git] / src / Registry / RegistryService.cxx
index ff216e7515261abb7529778407e551f93954c0e5..52a3d1e9a75423b7ec2d9e44958d6291eed12e93 100644 (file)
@@ -1,14 +1,31 @@
-using namespace std;
-//=============================================================================
-// File      : RegistryService.cxx
-// Created   : Mon Nov  5 17:26:23 CET 2001
-// Author    : Pascale NOYRET - Antoine YESSAYAN, EDF
-// Project   : SALOME
-// Copyright : EDF 2001
-// $Header$
-//=============================================================================
+//  SALOME Registry : Registry server implementation
+//
+//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
+// 
+//  This library is free software; you can redistribute it and/or 
+//  modify it under the terms of the GNU Lesser General Public 
+//  License as published by the Free Software Foundation; either 
+//  version 2.1 of the License. 
+// 
+//  This library is distributed in the hope that it will be useful, 
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of 
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU 
+//  Lesser General Public License for more details. 
+// 
+//  You should have received a copy of the GNU Lesser General Public 
+//  License along with this library; if not, write to the Free Software 
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA 
+// 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//
+//
+//  File   : RegistryService.cxx
+//  Author : Pascale NOYRET - Antoine YESSAYAN, EDF
+//  Module : SALOME
+//  $Header$
 
-using namespace std;
 # include "RegistryService.hxx"
 # include "OpUtil.hxx"
 # include "utilities.h"
@@ -18,7 +35,12 @@ extern "C"
 # include <time.h>
 }
 
+#ifndef WNT
 #include <unistd.h>
+#else
+#include <process.h>
+#endif
+using namespace std;
 
 /* ------------------------------*/
 /* Constructeurs et Destructeurs */
@@ -27,7 +49,7 @@ extern "C"
 RegistryService::RegistryService( void ) : _SessionName(0), _Compteur(0)
 {
        MESSAGE("Passage dans RegistryService::RegistryService()") ;
-
+       _orb = CORBA::ORB::_nil();
 }
 
 
@@ -52,7 +74,11 @@ RegistryService::~RegistryService()
        _Compteur = -1 ;
        if ( _SessionName )
        {
+#ifndef WNT
                delete [] _SessionName ;
+#else
+               delete [] (char*)_SessionName ;
+#endif
                _SessionName = 0 ;
        }
        END_OF("RegistryService::~RegistryService()") ;
@@ -86,8 +112,11 @@ CORBA::ULong RegistryService::add( const Registry::Infos & infos )
        return (CORBA::ULong)_Compteur ;
 }
 
-
+#ifndef WNT
 void RegistryService::remove( const CORBA::ULong id)
+#else
+void RegistryService::remove( CORBA::ULong id)
+#endif
 {
        BEGIN_OF("RegistryService::remove") ;
        SCRUTE(id) ;
@@ -111,8 +140,11 @@ void RegistryService::remove( const CORBA::ULong id)
 }
 
 
-
+#ifndef WNT
 void RegistryService::hello( const CORBA::ULong id )
+#else
+void RegistryService::hello( CORBA::ULong id )
+#endif
 {
        BEGIN_OF("RegistryService::hello") ;
        SCRUTE(id) ;
@@ -227,5 +259,14 @@ void RegistryService::SessionName( const char *sessionName )
 }
 void RegistryService::ping()
 {
+#ifndef WNT
   MESSAGE(" RegistryService::ping() pid "<< getpid());
+#else
+  MESSAGE(" RegistryService::ping() pid "<< _getpid());
+#endif
+}
+
+CORBA::Long RegistryService::getPID()
+{
+  return (CORBA::Long)getpid();
 }