-// 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
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);
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