From: Anthony Geay Date: Fri, 5 Jan 2018 14:49:22 +0000 (+0100) Subject: Because an order can t be discussed X-Git-Tag: V9_0_0~1^2~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=abbc7a541cded5d94bf9264d2fff0bd7ec2ed53c;p=modules%2Fkernel.git Because an order can t be discussed --- diff --git a/idl/SALOME_SDS.idl b/idl/SALOME_SDS.idl index 7e658252d..2ffd40d9c 100644 --- a/idl/SALOME_SDS.idl +++ b/idl/SALOME_SDS.idl @@ -82,6 +82,7 @@ module SALOME { StringVec listVars(); ByteVec fetchSerializedContent(in string varName) raises (SALOME::SALOME_Exception); + void fetchAndGetAccessOfVar(in string varName, out string access, out ByteVec data) raises (SALOME::SALOME_Exception); }; interface RequestSwitcherDSM : RequestSwitcherBase @@ -99,7 +100,6 @@ module SALOME boolean shutdownIfNotHostedByDSM(out DataScopeKiller killer) raises (SALOME::SALOME_Exception); ByteVec fetchSerializedContent(in string varName) raises (SALOME::SALOME_Exception); SeqOfByteVec getAllKeysOfVarWithTypeDict(in string varName) raises (SALOME::SALOME_Exception); - RequestSwitcher getRequestSwitcher(); void takeANap(in double napDurationInSec) raises (SALOME::SALOME_Exception); }; @@ -150,6 +150,7 @@ module SALOME 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); + RequestSwitcher getRequestSwitcher(); }; interface DataServerManager diff --git a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx index 7622f6d10..b15bf94e2 100644 --- a/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx +++ b/src/SALOMESDS/SALOMESDS_DataScopeServer.cxx @@ -52,7 +52,7 @@ void DataScopeKiller::shutdown() _orb->shutdown(0); } -RequestSwitcher::RequestSwitcher(CORBA::ORB_ptr orb, DataScopeServerBase *ds):RequestSwitcherBase(orb),_ds(ds) +RequestSwitcher::RequestSwitcher(CORBA::ORB_ptr orb, DataScopeServerTransaction *ds):RequestSwitcherBase(orb),_ds(ds) { } @@ -66,6 +66,11 @@ SALOME::ByteVec *RequestSwitcher::fetchSerializedContent(const char *varName) return _ds->fetchSerializedContent(varName); } +void RequestSwitcher::fetchAndGetAccessOfVar(const char *varName, CORBA::String_out access, SALOME::ByteVec_out data) +{ + return _ds->fetchAndGetAccessOfVar(varName,access,data); +} + DataScopeServerBase::DataScopeServerBase(CORBA::ORB_ptr orb, SALOME::DataScopeKiller_var killer, const std::string& scopeName):_globals(0),_locals(0),_pickler(0),_orb(CORBA::ORB::_duplicate(orb)),_name(scopeName),_killer(killer) { } @@ -240,16 +245,6 @@ SALOME::SeqOfByteVec *DataScopeServerBase::getAllKeysOfVarWithTypeDict(const cha return ret; } -SALOME::RequestSwitcher_ptr DataScopeServerBase::getRequestSwitcher() -{ - if(_rs.isNull()) - { - _rs=new RequestSwitcher(_orb,this); - } - CORBA::Object_var obj(_rs->activate()); - return SALOME::RequestSwitcher::_narrow(obj); -} - void DataScopeServerBase::takeANap(CORBA::Double napDurationInSec) { if(napDurationInSec<0.) @@ -892,3 +887,12 @@ DataScopeServerTransaction::~DataScopeServerTransaction() { } +SALOME::RequestSwitcher_ptr DataScopeServerTransaction::getRequestSwitcher() +{ + if(_rs.isNull()) + { + _rs=new RequestSwitcher(_orb,this); + } + CORBA::Object_var obj(_rs->activate()); + return SALOME::RequestSwitcher::_narrow(obj); +} diff --git a/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx b/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx index 05468fc08..c12add197 100644 --- a/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx +++ b/src/SALOMESDS/SALOMESDS_DataScopeServer.hxx @@ -47,7 +47,7 @@ namespace SALOMESDS CORBA::ORB_var _orb; }; - class DataScopeServerBase; + class DataScopeServerTransaction; /*! * Servant activated by a specific POA (single thread) having itself its specific POA_manager. @@ -56,12 +56,13 @@ namespace SALOMESDS class SALOMESDS_EXPORT RequestSwitcher : public RequestSwitcherBase, public virtual POA_SALOME::RequestSwitcher { public: - RequestSwitcher(CORBA::ORB_ptr orb, DataScopeServerBase *ds); + RequestSwitcher(CORBA::ORB_ptr orb, DataScopeServerTransaction *ds); SALOME::StringVec *listVars(); SALOME::ByteVec *fetchSerializedContent(const char *varName); + void fetchAndGetAccessOfVar(const char *varName, CORBA::String_out access, SALOME::ByteVec_out data); private: //! handle on its creator to give access to services when _poa_manager_under_control is in hold mode. - DataScopeServerBase *_ds; + DataScopeServerTransaction *_ds; }; class KeyWaiter; @@ -82,7 +83,6 @@ namespace SALOMESDS CORBA::Boolean shutdownIfNotHostedByDSM(SALOME::DataScopeKiller_out killer); SALOME::ByteVec *fetchSerializedContent(const char *varName); SALOME::SeqOfByteVec *getAllKeysOfVarWithTypeDict(const char *varName); - SALOME::RequestSwitcher_ptr getRequestSwitcher(); void takeANap(CORBA::Double napDurationInSec); public: ~DataScopeServerBase(); @@ -120,7 +120,6 @@ namespace SALOMESDS std::string _name; std::list< std::pair< SALOME::BasicDataServer_var, BasicDataServer * > > _vars; SALOME::DataScopeKiller_var _killer; - AutoServantPtr _rs; static std::size_t COUNTER; }; @@ -168,11 +167,13 @@ namespace SALOMESDS SALOME::KeyWaiter_ptr waitForKeyInVar(const char *varName, const SALOME::ByteVec& keyVal); SALOME::KeyWaiter_ptr waitForKeyInVarAndKillIt(const char *varName, const SALOME::ByteVec& keyVal, SALOME::Transaction_out transac); void atomicApply(const SALOME::ListOfTransaction& transactions); + SALOME::RequestSwitcher_ptr getRequestSwitcher(); private: PyObject *getPyCmpFunc(); private: PortableServer::POA_var _poa_for_key_waiter; std::list< KeyWaiter * > _waiting_keys; + AutoServantPtr _rs; }; }