KeyWaiter waitForKeyInVarAndKillIt(in string varName, in ByteVec keyVal, out Transaction transac) raises (SALOME::SALOME_Exception);
void atomicApply(in ListOfTransaction transactions) raises (SALOME::SALOME_Exception);
ByteVec waitForMonoThrRev(in KeyWaiter kw) raises (SALOME::SALOME_Exception);
+ ByteVec waitForAndKill(in KeyWaiter kw) raises (SALOME::SALOME_Exception);
};
interface DataServerManager
return zeRet;
}
+SALOME::ByteVec *DataScopeServerTransaction::waitForAndKill(SALOME::KeyWaiter_ptr kw)
+{
+ PortableServer::ServantBase *ret(0);
+ try
+ {
+ ret=_poa_for_key_waiter->reference_to_servant(kw);// Warning ref cnt of ret has been incremented !
+ }
+ catch(...) { ret=0; }
+ KeyWaiter *retc(dynamic_cast<KeyWaiter *>(ret));
+ if(!retc)
+ throw Exception("DataScopeServerTransaction::invokeMonoThr : internal error 1 !");
+ retc->_remove_ref();// restore the counter afer _poa_for_key_waiter->reference_to_servant(kw)
+ SALOME::ByteVec *zeRet(retc->waitForAndKill());
+ retc->enforcedRelease();
+ return zeRet;
+}
+
void DataScopeServerTransaction::atomicApply(const SALOME::ListOfTransaction& transactions)
{
std::size_t sz(transactions.length());
void pingKey(PyObject *keyObj);
void notifyKey(const std::string& varName, PyObject *keyObj, PyObject *valueObj);
SALOME::ByteVec *waitForMonoThrRev(SALOME::KeyWaiter_ptr kw);
+ SALOME::ByteVec *waitForAndKill(SALOME::KeyWaiter_ptr kw);
public://remotely callable
char *getAccessOfVar(const char *varName);
void fetchAndGetAccessOfVar(const char *varName, CORBA::String_out access, SALOME::ByteVec_out data);
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 !
*/
void go();
std::string getVarName() const { return _var->getVarNameCpp(); }
SALOME::ByteVec *waitForMonoThr();
+ SALOME::ByteVec *waitForAndKill();
private:
DataScopeServerTransaction *getDSS() const { return static_cast<DataScopeServerTransaction *>(_var->getFather()); }//thanks to dynamic_cast in constructor
private: