From 23d97fe9bab2eb3b939cb7332ece4caf84a4a764 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Fri, 10 Feb 2023 17:25:23 +0100 Subject: [PATCH] [EDF26936] : 64bits integer to specify range + remote destruction of SALOME::SenderByte servant --- idl/SALOME_Comm.idl | 7 ++++--- src/Communication/ReceiverFactory.cxx | 4 ++++ src/Communication/ReceiverFactory.hxx | 1 + src/Container/SALOME_PyNode.py | 7 ++++--- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/idl/SALOME_Comm.idl b/idl/SALOME_Comm.idl index 911629531..ee4c95341 100644 --- a/idl/SALOME_Comm.idl +++ b/idl/SALOME_Comm.idl @@ -23,6 +23,7 @@ #ifndef _SALOME_COMM_IDL_ #define _SALOME_COMM_IDL_ +#include "SALOME_GenericObj.idl" #include "SALOME_Exception.idl" /*! @@ -135,10 +136,10 @@ module SALOME { void release(); }; - interface SenderByte + interface SenderByte : GenericObj { - unsigned long getSize(); - vectorOfByte sendPart(in unsigned long n1,in unsigned long n2); + unsigned long long getSize(); + vectorOfByte sendPart(in unsigned long long n1,in unsigned long long n2); }; }; diff --git a/src/Communication/ReceiverFactory.cxx b/src/Communication/ReceiverFactory.cxx index 44ff3a0cd..13cf127cd 100644 --- a/src/Communication/ReceiverFactory.cxx +++ b/src/Communication/ReceiverFactory.cxx @@ -226,3 +226,7 @@ void SeqByteReceiver::fetchByChunks(unsigned long size) } } +SeqByteReceiver::~SeqByteReceiver() +{ + _obj->UnRegister(); +} diff --git a/src/Communication/ReceiverFactory.hxx b/src/Communication/ReceiverFactory.hxx index 3d61b262f..c566ea9d0 100644 --- a/src/Communication/ReceiverFactory.hxx +++ b/src/Communication/ReceiverFactory.hxx @@ -50,6 +50,7 @@ class COMMUNICATION_EXPORT SeqByteReceiver public: SeqByteReceiver(SALOME::SenderByte_ptr sender); char *data(unsigned long& size); + ~SeqByteReceiver(); private: void fetchOneShot(unsigned long size); void fetchByChunks(unsigned long size); diff --git a/src/Container/SALOME_PyNode.py b/src/Container/SALOME_PyNode.py index 1a0b3eb0b..abe082376 100644 --- a/src/Container/SALOME_PyNode.py +++ b/src/Container/SALOME_PyNode.py @@ -103,8 +103,9 @@ class PyNode_i (Engines__POA.PyNode,Generic): l=traceback.format_exception(exc_typ,exc_val,exc_fr) raise SALOME.SALOME_Exception(SALOME.ExceptionStruct(SALOME.BAD_PARAM,"".join(l),"PyNode: %s, function: %s" % (self.nodeName,funcName),0)) -class SenderByte_i(SALOME__POA.SenderByte): - def __init__(self,bytesToSend): +class SenderByte_i(SALOME__POA.SenderByte,Generic): + def __init__(self,poa,bytesToSend): + Generic.__init__(self,poa) self.bytesToSend = bytesToSend def getSize(self): @@ -193,7 +194,7 @@ class PyScriptNode_i (Engines__POA.PyScriptNode,Generic): raise KeyError("There is no variable %s in context" % arg) argsout.append(self.context[arg]) argsout=pickle.dumps(tuple(argsout),-1) - ret = SenderByte_i( argsout ) + ret = SenderByte_i( self.poa,argsout ) id_o = self.poa.activate_object(ret) retObj = self.poa.id_to_reference(id_o) return retObj._narrow( SALOME.SenderByte ) -- 2.39.2