Salome HOME
python_test_driver.py declination of salome_test_driver.py for SSL mode (timeout...
[modules/kernel.git] / src / SALOMESDS / SALOMESDS_PickelizedPyObjServer.hxx
index 2b64906511f26c302cca5db7544495a6e205ed79..365ac5bdb9f46910ffe677c5084f627a418d5786 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -37,17 +37,19 @@ namespace SALOMESDS
   public:
     PickelizedPyObjServer(DataScopeServerBase *father, const std::string& varName, const SALOME::ByteVec& value);
     PickelizedPyObjServer(DataScopeServerBase *father, const std::string& varName, PyObject *obj);
-    ~PickelizedPyObjServer();
+    virtual ~PickelizedPyObjServer();
     void setSerializedContent(const SALOME::ByteVec& newValue);
     SALOME::ByteVec *fetchSerializedContent();
   public:
     bool isDict();
     void checkKeyNotAlreadyPresent(PyObject *key);
     void checkKeyPresent(PyObject *key);
-    void addKeyValueHard(PyObject *key, PyObject *value);
-    void addKeyValueErrorIfAlreadyExisting(PyObject *key, PyObject *value);
-    void removeKeyInVarErrorIfNotAlreadyExisting(PyObject *key);
     PyObject *getPyObj() const { return _self; }
+  public:
+    virtual void addKeyValueHard(PyObject *key, PyObject *value);
+    virtual void removeKeyInVarErrorIfNotAlreadyExisting(PyObject *key);
+    virtual void addKeyValueErrorIfAlreadyExisting(PyObject *key, PyObject *value) = 0;
+    virtual std::string getAccessStr() const = 0;
   public:
     static void FromByteSeqToCpp(const SALOME::ByteVec& bsToBeConv, std::string& ret);
     static void FromCppToByteSeq(const std::string& strToBeConv, SALOME::ByteVec& ret);
@@ -68,6 +70,16 @@ namespace SALOMESDS
     PyObject *_self;
     PortableServer::POA_var _poa;
   };
+
+  class PickelizedPyObjServerModifiable : public PickelizedPyObjServer
+  {
+  public:
+    PickelizedPyObjServerModifiable(DataScopeServerBase *father, const std::string& varName, const SALOME::ByteVec& value);
+    PickelizedPyObjServerModifiable(DataScopeServerBase *father, const std::string& varName, PyObject *obj);
+  public:
+    void addKeyValueErrorIfAlreadyExisting(PyObject *key, PyObject *value);
+    void removeKeyInVarErrorIfNotAlreadyExisting(PyObject *key);
+  };
 }
 
 #endif