Salome HOME
bos #26457 Factorization of ORB initialization vuzlov/26457
authorvsr <vsr@opencascade.com>
Tue, 19 Oct 2021 11:56:38 +0000 (14:56 +0300)
committervsr <vsr@opencascade.com>
Tue, 19 Oct 2021 11:56:38 +0000 (14:56 +0300)
src/AddComponent/AddComponent_CheckOfUndefined.cxx
src/AddComponent/AddComponent_Impl.cxx
src/AddComponent/Adder_Impl.cxx
src/AdditionComponent/AdditionComponent_Impl.cxx
src/AdditionComponent/Addition_Adder_Impl.cxx
src/SIGNALSComponent/SIGNALSComponent_CheckOfUndefined.cxx

index 79af8996c7f21b255cbe406240e3926750963417..b44c8032c2d942a702c4b9ee4e094de6f405b546 100644 (file)
@@ -38,8 +38,6 @@
 #endif
 #include "SALOME_Container_i.hxx"
 #include "utilities.h"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
 #include "SALOMETraceCollector.hxx"
 #include "OpUtil.hxx"
 
@@ -83,9 +81,7 @@ int main(int argc, char* argv[])
   // Initialise the ORB.
   //SRN: BugID: IPAL9541, it's necessary to set a size of one message to be at least 100Mb
   //CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ;
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
-  CORBA::ORB_var orb = init(0 , 0 ) ;
+  CORBA::ORB_var orb = KERNEL::GetRefToORB();
          
   //SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
   INFOS_COMPILATION;
index 2e0dbd1acda2ea17f4e7c6322d51d5ab1c032e88..5cf5f2e402386578cede8400823f0528d6e9056f 100644 (file)
@@ -36,8 +36,7 @@
 #include <string>
 
 #include "utilities.h"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
+#include "OpUtil.hxx"
 #include "SALOME_NamingService.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
 
@@ -238,9 +237,7 @@ CORBA::Boolean AddComponent_Impl::AdditionObjRefs( SuperVisionTest::AddComponent
   bool RetVal = true ;
   beginService( "AddComponent_Impl::AdditionObjRefs" );
   cout << "beginService AddComponent_Impl::AdditionObjRefs" << endl ;
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
-  CORBA::ORB_var orb = init(0 , 0 ) ;
+  CORBA::ORB_var orb = KERNEL::GetRefToORB();
   char * IOR = orb->object_to_string( AddComponent1 );
   cout << "AddComponent_Impl::AdditionObjRefs AddComponent1 " << AddComponent1 << " IOR "
        << IOR << " nil " << CORBA::is_nil( AddComponent1 ) << endl ;
index 3f416c3e31bef3bd6917f0a4a0b7ab8630a053f8..b5bc5fc73cd2b3e84f83546b3edfd0708cf0cdf2 100644 (file)
@@ -34,8 +34,7 @@
 #include <string>
 
 #include "utilities.h"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
+#include "OpUtil.hxx"
 #include "SALOME_NamingService.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
 
@@ -196,9 +195,7 @@ Engines::EngineComponent_ptr Adder_Impl::LccAddComponent( const char * aContaine
   Engines::EngineComponent_ptr objComponent ;
   objComponent = Engines::EngineComponent::_nil() ;
 
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
-  CORBA::ORB_var orb = init(0 , 0 ) ;
+  CORBA::ORB_var orb = KERNEL::GetRefToORB();
   SALOME_NamingService *_NS ;
   _NS = new SALOME_NamingService();
   _NS->init_orb( CORBA::ORB::_duplicate(orb) ) ;
index 33c5a3976772c273d1b38a69dbc7989e5aba248a..f19448b9c0dbe7420701979d462dfbd9d7c6e773 100644 (file)
@@ -36,8 +36,7 @@
 #include <string>
 
 #include "utilities.h"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
+#include "OpUtil.hxx"
 #include "SALOME_NamingService.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
 
@@ -237,9 +236,7 @@ CORBA::Boolean AdditionInterface_Impl::AdditionObjRefs( AdditionComponent::Addit
   bool RetVal = true ;
   beginService( "AdditionInterface_Impl::AdditionObjRefs" );
   cout << "beginService AdditionInterface_Impl::AdditionObjRefs" << endl ;
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
-  CORBA::ORB_var orb = init(0 , 0 ) ;
+  CORBA::ORB_var orb = KERNEL::GetRefToORB();
   char * IOR = orb->object_to_string( AdditionInterface1 );
   cout << "AdditionInterface_Impl::AdditionObjRefs AdditionInterface1 " << AdditionInterface1 << " IOR "
        << IOR << " nil " << CORBA::is_nil( AdditionInterface1 ) << endl ;
index 8edac9d6e5aea16ffbc8ea5be58d31188d6ff69f..303c71b726bd3a7787606d48b9c797a6daa985d9 100644 (file)
@@ -34,8 +34,7 @@
 #include <string>
 
 #include "utilities.h"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
+#include "OpUtil.hxx"
 #include "SALOME_NamingService.hxx"
 #include "SALOME_LifeCycleCORBA.hxx"
 
@@ -196,9 +195,7 @@ Engines::EngineComponent_ptr Adder_Impl::LccAdditionInterface( const char * aCon
   Engines::EngineComponent_ptr objComponent ;
   objComponent = Engines::EngineComponent::_nil() ;
 
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
-  CORBA::ORB_var orb = init(0 , 0 ) ;
+  CORBA::ORB_var orb = KERNEL::GetRefToORB();
   SALOME_NamingService *_NS ;
   _NS = new SALOME_NamingService();
   _NS->init_orb( CORBA::ORB::_duplicate(orb) ) ;
index 2f27c63ccc29d30b9047359d43108959e01241e6..856e90bfbdc3bac4c9d01816dbed56dc05972bae 100644 (file)
@@ -37,8 +37,6 @@
 #endif
 #include "SALOME_Container_i.hxx"
 #include "utilities.h"
-#include "Utils_ORB_INIT.hxx"
-#include "Utils_SINGLETON.hxx"
 #include "SALOMETraceCollector.hxx"
 #include "OpUtil.hxx"
 
@@ -83,9 +81,7 @@ int main(int argc, char* argv[])
   // Initialise the ORB.
   //SRN: BugID: IPAL9541, it's necessary to set a size of one message to be at least 100Mb
   //CORBA::ORB_var orb = CORBA::ORB_init( argc , argv ) ;
-  ORB_INIT &init = *SINGLETON_<ORB_INIT>::Instance() ;
-  ASSERT(SINGLETON_<ORB_INIT>::IsAlreadyExisting());
-  CORBA::ORB_var orb = init(0 , 0 ) ;
+  CORBA::ORB_var orb = KERNEL::GetRefToORB();
          
   //SALOMETraceCollector *myThreadTrace = SALOMETraceCollector::instance(orb);
   INFOS_COMPILATION;