From 1f1670c987af4441732c0ef3855816192350982a Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Thu, 14 Aug 2014 08:49:25 +0200 Subject: [PATCH] The final tuning for remote python nodes. --- src/runtime/PythonNode.cxx | 16 ++++++++++++++++ src/runtime/PythonNode.hxx | 2 ++ 2 files changed, 18 insertions(+) diff --git a/src/runtime/PythonNode.cxx b/src/runtime/PythonNode.cxx index 72df372bf..82cfb19e9 100644 --- a/src/runtime/PythonNode.cxx +++ b/src/runtime/PythonNode.cxx @@ -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); } diff --git a/src/runtime/PythonNode.hxx b/src/runtime/PythonNode.hxx index 8ccd4ec1c..4fca1f072 100644 --- a/src/runtime/PythonNode.hxx +++ b/src/runtime/PythonNode.hxx @@ -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; -- 2.39.2