From: Anthony Geay Date: Thu, 22 Oct 2015 09:30:22 +0000 (+0200) Subject: Give possiblity to have access and data atomically in one shot for checkpoint/restart... X-Git-Tag: V8_0_pre~6 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=045f6f136b1439e05b81eb63602d9181254da7b5;p=modules%2Fkernel.git Give possiblity to have access and data atomically in one shot for checkpoint/restart mechanism. --- diff --git a/idl/SALOME_SDS.idl b/idl/SALOME_SDS.idl index a01e1576c..43b5e2514 100644 --- a/idl/SALOME_SDS.idl +++ b/idl/SALOME_SDS.idl @@ -115,6 +115,7 @@ module SALOME interface DataScopeServerTransaction : DataScopeServerBase { string getAccessOfVar(in string varName) raises (SALOME::SALOME_Exception); + void fetchAndGetAccessOfVar(in string varName, out string access, out ByteVec data) raises (SALOME::SALOME_Exception); Transaction createRdOnlyVarTransac(in string varName, in ByteVec constValue) raises (SALOME::SALOME_Exception); Transaction createRdExtVarTransac(in string varName, in ByteVec constValue) raises (SALOME::SALOME_Exception); Transaction createRdExtInitVarTransac(in string varName, in ByteVec constValue) raises (SALOME::SALOME_Exception); diff --git a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx index 76a78c8ee..9d1fe0df8 100644 --- a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx +++ b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx @@ -515,6 +515,15 @@ char *DataScopeServerTransaction::getAccessOfVar(const char *varName) return CORBA::string_dup(ret.c_str()); } +/*! + * This method is here to retrieve atomically accessStr and picklization. + */ +void DataScopeServerTransaction::fetchAndGetAccessOfVar(const char *varName, CORBA::String_out access, SALOME::ByteVec_out data) +{ + access=getAccessOfVar(varName); + data=fetchSerializedContent(varName); +} + void DataScopeServerTransaction::createRdOnlyVarInternal(const std::string& varName, const SALOME::ByteVec& constValue) { checkNotAlreadyExistingVar(varName); diff --git a/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx b/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx index 261b5ac00..bdca97cf8 100644 --- a/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx +++ b/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx @@ -131,6 +131,7 @@ namespace SALOMESDS SALOME::ByteVec *waitForMonoThrRev(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); SALOME::Transaction_ptr createRdOnlyVarTransac(const char *varName, const SALOME::ByteVec& constValue); SALOME::Transaction_ptr createRdExtVarTransac(const char *varName, const SALOME::ByteVec& constValue); SALOME::Transaction_ptr createRdExtInitVarTransac(const char *varName, const SALOME::ByteVec& constValue);