Salome HOME
Updated copyright comment
[samples/component.git] / src / AdditionComponent / Addition_Adder_Impl.cxx
index b8f29d7595b281aebe62004d3b76293a5f08ac2d..ed7806b6a587d22ad2fde8a8061f678dab56bb7b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  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
@@ -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"
 
@@ -50,12 +49,12 @@ Adder_Impl::Adder_Impl( CORBA::ORB_ptr orb ,
                        const char * instanceName ,
                         const char * interfaceName , 
                        const char * graphName ,
-                        const char * nodeName ) :
-  Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,true) {
+                        const char * nodeName, bool withRegistry ) :
+  Engines_Component_i(orb, poa, contId, instanceName, interfaceName,1,withRegistry) {
   Names( graphName , nodeName ) ;
   MESSAGE("Adder_Impl::Adder_Impl activate object instanceName("
           << instanceName << ") interfaceName(" << interfaceName << ") --> "
-          << hex << (void *) this << dec )
+          << hex << (void *) this << dec );
   beginService( "Adder_Impl::Adder_Impl" );
   _thisObj = this ;
   _id = _poa->activate_object(_thisObj);
@@ -105,7 +104,7 @@ CORBA::Double Adder_Impl::Add( CORBA::Double x , CORBA::Double y , CORBA::Double
   Sleep(S*1000);
 #endif
   MESSAGE( "Adder_Impl::Add( " <<  x << " , " << y << " , " << z
-       << " ) returns " << -(x - y) << " after " << S << " seconds" )
+       << " ) returns " << -(x - y) << " after " << S << " seconds" );
   LastAddition = z ;
   endService( " Adder_Impl::Add"  );
   return -(x - y) ;
@@ -136,7 +135,7 @@ CORBA::Double Adder_Impl::AddAndCompare( CORBA::Double x , CORBA::Double y ,
   Sleep(S*1000);
 #endif
   MESSAGE( "Adder_Impl::AddAndCompare( " <<  x << " , " << y << " , " << z
-       << " ) returns " << -(x - y) << " after " << S << " seconds" )
+       << " ) returns " << -(x - y) << " after " << S << " seconds" );
   LastAddition = z ;
   double ValFunc ;
   sendMessage(NOTIF_TRACE, "Adder_Impl::AddAndCompare will call anOtherAdder->LastValue()");
@@ -190,15 +189,13 @@ void Adder_Impl::LastResult( CORBA::Double & z ) {
   return ;
 }
 
-Engines::EngineComponent_ptr Adder_Impl::LccAdditionInterface( char * aContainer ,
-                                                               char * aComponentName ) {
+Engines::EngineComponent_ptr Adder_Impl::LccAdditionInterface( const char * aContainer ,
+                                                               const char * aComponentName ) {
   beginService( "Adder_Impl::LccAddComponent" );
   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) ) ;