]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CCAR :
authorcaremoli <caremoli>
Fri, 26 Sep 2008 15:16:48 +0000 (15:16 +0000)
committercaremoli <caremoli>
Fri, 26 Sep 2008 15:16:48 +0000 (15:16 +0000)
INTERFACE CHANGE : add a boolean parameter regist with default value true to one Component constructor

It was needed to avoid calling registry two times for a python superv_component
Registry was called in the python constructor and in the corba proxy (class PySupervCompo)
that is used to implement DSC ports for python component.
As regist value is true by default there is no impact on other parts of KERNEL or of modules.

src/Container/Component_i.cxx
src/Container/SALOME_Component_i.hxx
src/DSC/DSC_Basic/DSC_i.cxx
src/DSC/DSC_Basic/DSC_i.hxx
src/DSC/DSC_User/Datastream/Calcium/Calcium.cxx
src/DSC/DSC_User/Superv_Component_i.cxx
src/DSC/DSC_User/Superv_Component_i.hxx

index 885750da9ed96f7101f1e2158805677b304a1541..b92cf0708031607e9c0b1ad09f209612b4de04be 100644 (file)
@@ -125,6 +125,7 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb,
  *  \param instanceName unique instance name for this object (see Container_i)
  *  \param interfaceName component class name
  *  \param notif use of notification
+ *  \param regist (true or false) use of registry (default true)
  */
 //=============================================================================
 
@@ -133,7 +134,8 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb,
                                          Engines::Container_ptr container,
                                          const char *instanceName,
                                          const char *interfaceName,
-                                         bool notif) :
+                                         bool notif,
+                                         bool regist) :
   _instanceName(instanceName),
   _interfaceName(interfaceName),
   _myConnexionToRegistry(0),
@@ -160,7 +162,8 @@ Engines_Component_i::Engines_Component_i(CORBA::ORB_ptr orb,
       _contId = 0;
     }
   const CORBA::String_var ior = _orb->object_to_string(_container);
-  _myConnexionToRegistry = new RegistryConnexion(0, 0, ior,"theSession", _instanceName.c_str());
+  if(regist)
+    _myConnexionToRegistry = new RegistryConnexion(0, 0, ior,"theSession", _instanceName.c_str());
   _notifSupplier = new NOTIFICATION_Supplier(instanceName, notif);
 }
 
@@ -290,11 +293,10 @@ void Engines_Component_i::destroy()
   MESSAGE("Engines_Component_i::destroy()");
   //SCRUTE(pd_refCount);
 
-  delete _notifSupplier;
-  _notifSupplier = 0;
-
-  delete _myConnexionToRegistry;
+  if(_myConnexionToRegistry)delete _myConnexionToRegistry;
   _myConnexionToRegistry = 0 ;
+  if(_notifSupplier)delete _notifSupplier;
+  _notifSupplier = 0;
   if(_id)
     delete(_id) ;
   //SCRUTE(pd_refCount);
index 3d49b89c528a0342ba98a61c92e3f9b0dd7a3d5b..15421169561b2ee2652383b52d62230dff78253a 100644 (file)
@@ -67,8 +67,9 @@ public:
                      Engines::Container_ptr container, 
                      const char *instanceName, 
                      const char *interfaceName,
-                      bool notif = false);
-  // Consructeur pour composant parallele: ne pas faire appel au registry
+                      bool notif = false,
+                      bool regist=true);
+  // Constructor for parallel component : don't call registry
   Engines_Component_i(CORBA::ORB_ptr orb,
                      PortableServer::POA_ptr poa,
                      PortableServer::ObjectId * contId, 
index 2daa87423b6fe1872cfbabe9000de9607aaf3f05..7ae1e157b90920e7958bfd8ca720b9668cbbb155 100644 (file)
@@ -48,7 +48,9 @@ Engines_DSC_i(CORBA::ORB_ptr orb,
               Engines::Container_ptr container, 
               const char *instanceName,
               const char *interfaceName,
-              bool notif) : Engines_Component_i(orb, poa, container, instanceName, interfaceName) 
+              bool notif,
+              bool regist) : 
+    Engines_Component_i(orb, poa, container, instanceName, interfaceName,notif,regist) 
 {
 #ifdef _DEBUG_
   std::cerr << "--Engines_DSC_i: MARK 1 --" << instanceName << "----" << std::endl;
index a66be1d56e039c1b5df37696b18af74dd40f7c0f..98fc8a6ade5f2921bb8f3e92734fcbca178af867 100644 (file)
@@ -61,7 +61,8 @@ public:
                          Engines::Container_ptr container, 
                          const char *instanceName,
                          const char *interfaceName,
-                         bool notif = false);
+                         bool notif = false,
+        bool regist = true );
 
   virtual ~Engines_DSC_i();
 
index fde8203a883a32ef91b1556435fce8ae0c7c9f9e..4c245e621a3ffc7add2ee3abf1ab6f53d1fb72bb 100644 (file)
@@ -13,7 +13,7 @@ PySupervCompo::PySupervCompo( CORBA::ORB_ptr orb,
                               const char *instanceName,
                               const char *interfaceName,
                               bool notif) :
-  Superv_Component_i(orb, poa,contain, instanceName, interfaceName)
+  Superv_Component_i(orb, poa,contain, instanceName, interfaceName,false,false)
 {
 }
 
index 4a6449990a17011369addfff6c62565a3ef0894c..b4335d38f99d5258ce0ed35bb235985e1e647df5 100644 (file)
@@ -55,7 +55,9 @@ Superv_Component_i::Superv_Component_i(CORBA::ORB_ptr orb,
                                       Engines::Container_ptr container, 
                                       const char *instanceName,
                                       const char *interfaceName,
-                                      bool notif) : Engines_DSC_i(orb, poa, container, instanceName, interfaceName) 
+                                      bool notif,
+                                       bool regist) : 
+  Engines_DSC_i(orb, poa, container, instanceName, interfaceName,notif,regist) 
 {
 #ifdef _DEBUG_
   std::cerr << "--Superv_Component_i : MARK 1 ----  " << instanceName << "----" << std::endl;
index 2c8467e053ff73218682f481155d8a5ae4a06f23..35ccc8922a6b56cc2a60a32494f0a6f313a8b0a1 100644 (file)
@@ -70,7 +70,8 @@ public:
                     Engines::Container_ptr container, 
                     const char *instanceName,
                     const char *interfaceName,
-                    bool notif = false);
+                    bool notif = false,
+         bool regist = true );
   virtual ~Superv_Component_i();
 
   // Exceptions declarations.