-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
if(!var)
throw Exception("KeyWaiter constructor : Invalid glob var is NULL !");
if(!dynamic_cast<DataScopeServerTransaction *>(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());
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 !
*/