X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMESDS%2FSALOMESDS_KeyWaiter.cxx;h=dbd6aaa624558226a799a45c73a1c39f4ad5267e;hb=f6120c1bdb84ed1cc827ffab8284c0ac2709189f;hp=ca951bcdace303d263138176845d7dc450f1faf0;hpb=accfa6fec5c2b3f25cd375eb136afd1aa4f2354a;p=modules%2Fkernel.git diff --git a/src/SALOMESDS/SALOMESDS_KeyWaiter.cxx b/src/SALOMESDS/SALOMESDS_KeyWaiter.cxx index ca951bcda..dbd6aaa62 100644 --- a/src/SALOMESDS/SALOMESDS_KeyWaiter.cxx +++ b/src/SALOMESDS/SALOMESDS_KeyWaiter.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -33,7 +33,7 @@ KeyWaiter::KeyWaiter(PickelizedPyObjServer *var, const SALOME::ByteVec& keyVal): if(!var) throw Exception("KeyWaiter constructor : Invalid glob var is NULL !"); if(!dynamic_cast(var->getFather())) - throw Exception("KeyWaiter constructor : Invalid glob var ! Invalid DataScope hosting it ! DataScopeServerTransaction excpected !"); + throw Exception("KeyWaiter constructor : Invalid glob var ! Invalid DataScope hosting it ! DataScopeServerTransaction expected !"); std::string st; PickelizedPyObjServer::FromByteSeqToCpp(keyVal,st); _ze_key=PickelizedPyObjServer::GetPyObjFromPickled(st,getDSS()); @@ -97,6 +97,19 @@ SALOME::ByteVec *KeyWaiter::waitForMonoThr() return PickelizedPyObjServer::FromCppToByteSeq(st); } +SALOME::ByteVec *KeyWaiter::waitForAndKill() +{ + if(!_ze_value) + throw Exception("KeyWaiter::waitForAndKill : no value ! invalid call of this method !"); + Py_XINCREF(_ze_value); + std::string st(PickelizedPyObjServer::Pickelize(_ze_value,_var->getFather())); + // + if(PyDict_DelItem(_var->getPyObj(),_ze_key)!=0) + throw Exception("KeyWaiter::waitForAndKill : error during entry removal !"); + // + return PickelizedPyObjServer::FromCppToByteSeq(st); +} + /*! * WARNING call this method before calling go ! */