Salome HOME
rollback merge error (sorry guys...)
[modules/yacs.git] / src / SALOMEDS / SALOMEDS_StudyManager.cxx
index 1dae939cc4bb9ddc814c480c1e25b53fd97b38ed..813d0820e89192f559314464c1e7c3addbb28b09 100644 (file)
@@ -1,27 +1,29 @@
-// Copyright (C) 2005  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  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 
+// 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 
+//
+// 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 
+// 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   : SALOMEDSClient_StudyManager.cxx
 //  Author : Sergey RUIN
 //  Module : SALOME
-
-
+//
 #include "SALOMEDS_StudyManager.hxx"
 
 #include "SALOMEDS.hxx"
@@ -35,6 +37,8 @@
 #include "Utils_ORB_INIT.hxx" 
 #include "Utils_SINGLETON.hxx" 
 
+#include "Basics_Utils.hxx"
+
 #ifdef WIN32
 #include <process.h>
 #else
 #include <unistd.h>
 #endif
 
-#include "OpUtil.hxx"
-
-using namespace std;
-
 SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_ptr orb);
 
 SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManager)
@@ -57,9 +57,9 @@ SALOMEDS_StudyManager::SALOMEDS_StudyManager(SALOMEDS::StudyManager_ptr theManag
   long pid =  (long)getpid();
 #endif  
 
-  CORBA::LongLong addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
+  CORBA::LongLong addr = theManager->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
   if(_isLocal) {
-    _local_impl = ((SALOMEDSImpl_StudyManager*)(addr));
+    _local_impl = reinterpret_cast<SALOMEDSImpl_StudyManager*>(addr);
     _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
   }
   else {
@@ -85,9 +85,9 @@ SALOMEDS_StudyManager::SALOMEDS_StudyManager()
   long pid =  (long)getpid();
 #endif  
 
-  CORBA::LongLong addr = theManager->GetLocalImpl(GetHostname().c_str(), pid, _isLocal);
+  CORBA::LongLong addr = theManager->GetLocalImpl(Kernel_Utils::GetHostname().c_str(), pid, _isLocal);
   if(_isLocal) {
-    _local_impl = ((SALOMEDSImpl_StudyManager*)(addr));
+    _local_impl = reinterpret_cast<SALOMEDSImpl_StudyManager*>(addr);
     _corba_impl = SALOMEDS::StudyManager::_duplicate(theManager);
   }
   else {
@@ -168,7 +168,7 @@ std::vector<std::string> SALOMEDS_StudyManager::GetOpenStudies()
   if (_isLocal) {
     SALOMEDS::Locker lock;
 
-    vector<SALOMEDSImpl_Study*> aSeq = _local_impl->GetOpenStudies();
+    std::vector<SALOMEDSImpl_Study*> aSeq = _local_impl->GetOpenStudies();
     aLength = aSeq.size();
     for(i = 0; i < aLength; i++) 
       aVector.push_back(aSeq[i]->Name());
@@ -314,7 +314,7 @@ SALOMEDS_Driver_i* GetDriver(const SALOMEDSImpl_SObject& theObject, CORBA::ORB_p
   
   SALOMEDSImpl_SComponent aSCO = theObject.GetFatherComponent();
   if(!aSCO.IsNull()) {
-    string IOREngine = aSCO.GetIOR();
+    std::string IOREngine = aSCO.GetIOR();
     if(!IOREngine.empty()) {
       CORBA::Object_var obj = orb->string_to_object(IOREngine.c_str());
       SALOMEDS::Driver_var Engine = SALOMEDS::Driver::_narrow(obj) ;