21 #ifndef __SALOMESDS_DATASCOPEERVER_HXX__
22 #define __SALOMESDS_DATASCOPEERVER_HXX__
24 #include "SALOMEconfig.h"
25 #include CORBA_SERVER_HEADER(SALOME_SDS)
55 DataScopeServerBase(CORBA::ORB_ptr orb, SALOME::DataScopeKiller_var killer,
const std::string& scopeName);
60 CORBA::Boolean existVar(
const char *varName);
61 SALOME::BasicDataServer_ptr retrieveVarInternal(
const char *varName);
62 void deleteVar(
const char *varName);
63 CORBA::Boolean shutdownIfNotHostedByDSM(SALOME::DataScopeKiller_out killer);
69 void initializePython(
int argc,
char *argv[]);
70 void registerToSalomePiDict()
const;
71 void setPOA(PortableServer::POA_var poa);
72 void registerInNS(SALOME::DataScopeServerBase_ptr ptr);
76 PortableServer::POA_var
getPOA()
const {
return _poa; }
77 CORBA::ORB_var
getORB() {
return _orb; }
79 static std::string BuildTmpVarNameFrom(
const std::string& varName);
81 std::vector< std::string> getAllVarNames()
const;
82 void checkNotAlreadyExistingVar(
const std::string& varName)
const;
83 void checkExistingVar(
const std::string& varName)
const;
86 void moveStatusOfVarFromRdWrToRdOnly(
const std::string& varName);
87 void moveStatusOfVarFromRdOnlyToRdWr(
const std::string& varName);
88 void moveStatusOfVarFromRdExtOrRdExtInitToRdExtInit(
const std::string& varName);
89 void moveStatusOfVarFromRdExtOrRdExtInitToRdExt(
const std::string& varName);
91 std::list< std::pair< SALOME::BasicDataServer_var, BasicDataServer * > >::const_iterator retrieveVarInternal3(
const std::string& varName)
const;
92 std::list< std::pair< SALOME::BasicDataServer_var, BasicDataServer * > >::iterator retrieveVarInternal4(
const std::string& varName);
97 PortableServer::POA_var
_poa;
100 std::list< std::pair< SALOME::BasicDataServer_var, BasicDataServer * > >
_vars;
108 DataScopeServer(CORBA::ORB_ptr orb, SALOME::DataScopeKiller_var killer,
const std::string& scopeName);
110 SALOME::BasicDataServer_ptr
retrieveVar(
const char *varName) {
return retrieveVarInternal(varName); }
111 SALOME::PickelizedPyObjRdOnlyServer_ptr createRdOnlyVar(
const char *varName,
const SALOME::ByteVec& constValue);
112 SALOME::PickelizedPyObjRdExtServer_ptr createRdExtVar(
const char *varName,
const SALOME::ByteVec& constValue);
113 SALOME::PickelizedPyObjRdWrServer_ptr createRdWrVar(
const char *typeName,
const char *varName);
123 void createRdOnlyVarInternal(
const std::string& varName,
const SALOME::ByteVec& constValue);
124 void createRdExtVarInternal(
const std::string& varName,
const SALOME::ByteVec& constValue);
125 void createRdExtInitVarInternal(
const std::string& varName,
const SALOME::ByteVec& constValue);
126 void createRdWrVarInternal(
const std::string& varName,
const SALOME::ByteVec& constValue);
129 void pingKey(PyObject *keyObj);
130 void notifyKey(
const std::string& varName, PyObject *keyObj, PyObject *valueObj);
134 char *getAccessOfVar(
const char *varName);
135 void fetchAndGetAccessOfVar(
const char *varName, CORBA::String_out access, SALOME::ByteVec_out data);
136 SALOME::Transaction_ptr createRdOnlyVarTransac(
const char *varName,
const SALOME::ByteVec& constValue);
137 SALOME::Transaction_ptr createRdExtVarTransac(
const char *varName,
const SALOME::ByteVec& constValue);
138 SALOME::Transaction_ptr createRdExtInitVarTransac(
const char *varName,
const SALOME::ByteVec& constValue);
139 SALOME::Transaction_ptr createRdWrVarTransac(
const char *varName,
const SALOME::ByteVec& constValue);
142 SALOME::TransactionMultiKeyAddSession_ptr addMultiKeyValueSession(
const char *varName);
143 SALOME::Transaction_ptr removeKeyInVarErrorIfNotAlreadyExisting(
const char *varName,
const SALOME::ByteVec& key);
144 SALOME::TransactionRdWrAccess_ptr createWorkingVarTransac(
const char *varName,
const SALOME::ByteVec& constValue);
145 SALOME::Transaction_ptr killVarTransac(
const char *varName);
146 SALOME::KeyWaiter_ptr waitForKeyInVar(
const char *varName,
const SALOME::ByteVec& keyVal);
147 SALOME::KeyWaiter_ptr waitForKeyInVarAndKillIt(
const char *varName,
const SALOME::ByteVec& keyVal, SALOME::Transaction_out transac);
150 PyObject *getPyCmpFunc();