]> SALOME platform Git repositories - modules/yacs.git/commitdiff
Salome HOME
The final tuning for remote python nodes.
authorAnthony Geay <anthony.geay@edf.fr>
Thu, 14 Aug 2014 06:49:25 +0000 (08:49 +0200)
committerAnthony Geay <anthony.geay@edf.fr>
Thu, 14 Aug 2014 06:49:25 +0000 (08:49 +0200)
src/runtime/PythonNode.cxx
src/runtime/PythonNode.hxx

index 72df372bfd25ab52161f5a1aa3f94d0422448265..82cfb19e91fcee467faee2034c0b981704128e20 100644 (file)
@@ -612,6 +612,14 @@ Engines::PyNodeBase_var PythonNode::retrieveDftRemotePyInterpretorIfAny(Engines:
 
 void PythonNode::assignRemotePyInterpretor(Engines::PyNodeBase_var remoteInterp)
 {
+  if(!CORBA::is_nil(_pynode))
+    {
+      Engines::PyScriptNode_var tmpp(Engines::PyScriptNode::_narrow(remoteInterp));
+      if(_pynode->_is_equivalent(tmpp))
+        return ;
+    }
+  if(!CORBA::is_nil(_pynode))
+    _pynode->UnRegister();
   _pynode=Engines::PyScriptNode::_narrow(remoteInterp);
 }
 
@@ -1064,6 +1072,14 @@ Engines::PyNodeBase_var PyFuncNode::retrieveDftRemotePyInterpretorIfAny(Engines:
 
 void PyFuncNode::assignRemotePyInterpretor(Engines::PyNodeBase_var remoteInterp)
 {
+  if(!CORBA::is_nil(_pynode))
+    {
+      Engines::PyNode_var tmpp(Engines::PyNode::_narrow(remoteInterp));
+      if(_pynode->_is_equivalent(tmpp))
+        return ;
+    }
+  if(!CORBA::is_nil(_pynode))
+    _pynode->UnRegister();
   _pynode=Engines::PyNode::_narrow(remoteInterp);
 }
 
index 8ccd4ec1cef75edb3d390d0214048e08219467d8..4fca1f072e4f970a54923db17f4f6f11a1c04d1f 100644 (file)
@@ -38,7 +38,9 @@ namespace YACS
       PythonEntry();
       ~PythonEntry();
       virtual void assignRemotePyInterpretor(Engines::PyNodeBase_var remoteInterp) = 0;
+      //! returns (if any) an object, you have to deal with (UnRegister)
       virtual Engines::PyNodeBase_var retrieveDftRemotePyInterpretorIfAny(Engines::Container_ptr objContainer) const = 0;
+      //! returns an object, you have to deal with (UnRegister)
       virtual void createRemoteAdaptedPyInterpretor(Engines::Container_ptr objContainer) = 0;
       virtual Engines::PyNodeBase_var getRemoteInterpreterHandle() = 0;
       virtual const char *getSerializationScript() const = 0;