Salome HOME
[EDF29093] : Quick fix resorbed
[modules/kernel.git] / src / SALOMEDS / SALOMEDS_StudyBuilder.cxx
index 8aeed232c52603500333f282389a497cf63501e2..120c90a51b0e67a26860463e553115332a5a2650 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2016  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023  CEA, EDF, OPEN CASCADE
 //
 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
@@ -32,7 +32,6 @@
 #include "SALOMEDS_SObject.hxx"
 #include "SALOMEDS_SComponent.hxx"
 #include "SALOMEDS_GenericAttribute.hxx"
-#include "SALOMEDS_StudyManager.hxx"
 #include "SALOMEDS_StudyBuilder_i.hxx"
 
 #include "SALOMEDS_Driver_i.hxx"
@@ -47,8 +46,7 @@
 #include "DF_Attribute.hxx"
 
 #include "Utils_CorbaException.hxx"
-#include "Utils_ORB_INIT.hxx" 
-#include "Utils_SINGLETON.hxx" 
+#include "OpUtil.hxx"
 
 pthread_mutex_t SALOMEDS_StudyBuilder::_remoteBuilderMutex;
 
@@ -175,23 +173,6 @@ _PTR(SObject) SALOMEDS_StudyBuilder::NewObjectToTag(const _PTR(SObject)& theFath
   return _PTR(SObject)(aSO);
 }
 
-void SALOMEDS_StudyBuilder::AddDirectory(const std::string& thePath)
-{
-  if (_isLocal) {
-    CheckLocked();
-    SALOMEDS::Locker lock;
-
-    _local_impl->AddDirectory((char*)thePath.c_str());
-    if (_local_impl->IsError()) {
-      std::string anErrorCode = _local_impl->GetErrorCode();
-      if (anErrorCode == "StudyNameAlreadyUsed")  throw SALOMEDS::Study::StudyNameAlreadyUsed(); 
-      if (anErrorCode == "StudyInvalidDirectory") throw SALOMEDS::Study::StudyInvalidDirectory(); 
-      if (anErrorCode == "StudyInvalidComponent") throw SALOMEDS::Study::StudyInvalidComponent();  
-    }
-  }
-  else _corba_impl->AddDirectory((char*)thePath.c_str());
-}
-
 void SALOMEDS_StudyBuilder::LoadWith(const _PTR(SComponent)& theSCO, const std::string& theIOR)
 {
   if(!theSCO) return;
@@ -567,7 +548,5 @@ SALOMEDS::StudyBuilder_ptr SALOMEDS_StudyBuilder::GetBuilder()
 
 void SALOMEDS_StudyBuilder::init_orb()
 {
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance();
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting()); 
-  _orb = init(0 , 0 );     
+  _orb = KERNEL::GetRefToORB();  
 }