-// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
#include "SALOMESDS_Defines.hxx"
#include "SALOMESDS_Exception.hxx"
#include "SALOMESDS_DataServerManager.hxx"
+#include "SALOMESDS_Auto.hxx"
#include <string>
#include <vector>
{
public:
TransactionVarCreate(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& constValue);
- void prepareRollBackInCaseOfFailure();
- void rollBack();
- void notify();
+ void prepareRollBackInCaseOfFailure() override;
+ void rollBack() override;
+ void notify() override;
protected:
std::vector<unsigned char> _data;
};
{
public:
TransactionRdExtVarCreate(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& constValue):TransactionVarCreate(dsct,varName,constValue) { }
- void perform();
+ void perform() override;
+ };
+
+ class TransactionRdExtVarFreeStyleCreate : public TransactionRdExtVarCreate
+ {
+ public:
+ TransactionRdExtVarFreeStyleCreate(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& constValue, const char *compareFuncContent);
+ void prepareRollBackInCaseOfFailure() override;
+ void rollBack() override;
+ void perform() override;
+ protected:
+ bool _null_rollback = false;
+ std::string _cmp_func_content;
+ SALOME::AutoPyRef _cmp_func;
};
class TransactionRdExtInitVarCreate : public TransactionVarCreate
{
public:
TransactionRdExtInitVarCreate(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& constValue):TransactionVarCreate(dsct,varName,constValue) { }
- void perform();
+ void perform() override;
};
class TransactionRdWrVarCreate : public TransactionVarCreate
{
public:
TransactionRdWrVarCreate(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& constValue):TransactionVarCreate(dsct,varName,constValue) { }
- void perform();
+ void perform() override;
};
class TransactionKillVar : public Transaction
{
public:
TransactionKillVar(DataScopeServerTransaction *dsct, const std::string& varName);
- void prepareRollBackInCaseOfFailure();
- void perform();
- void rollBack();
- void notify();
+ void prepareRollBackInCaseOfFailure() override;
+ void perform() override;
+ void rollBack() override;
+ void notify() override;
};
class PickelizedPyObjServer;
public:
TransactionDictModify(DataScopeServerTransaction *dsct, const std::string& varName);
PickelizedPyObjServer *checkVarExistingAndDict() { return _dsct->checkVarExistingAndDict(_var_name); }
- void prepareRollBackInCaseOfFailure();
- void rollBack();
+ void prepareRollBackInCaseOfFailure() override;
+ void rollBack() override;
protected:
std::string _zeDataBefore;
PickelizedPyObjServer *_varc;
{
public:
TransactionAddKeyValue(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& key, const SALOME::ByteVec& value);
- void prepareRollBackInCaseOfFailure();
- void notify();
+ void prepareRollBackInCaseOfFailure() override;
+ void notify() override;
~TransactionAddKeyValue();
protected:
PyObject *_key;
{
public:
TransactionAddKeyValueHard(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& key, const SALOME::ByteVec& value);
- void perform();
+ void perform() override;
};
class TransactionAddKeyValueErrorIfAlreadyExisting : public TransactionAddKeyValue
{
public:
TransactionAddKeyValueErrorIfAlreadyExisting(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& key, const SALOME::ByteVec& value);
- void perform();
+ void perform() override;
};
class TransactionRemoveKeyInVarErrorIfNotAlreadyExisting : public TransactionDictModify
{
public:
TransactionRemoveKeyInVarErrorIfNotAlreadyExisting(DataScopeServerTransaction *dsct, const std::string& varName, const SALOME::ByteVec& key);
- void perform();
- void notify();
+ void perform() override;
+ void notify() override;
~TransactionRemoveKeyInVarErrorIfNotAlreadyExisting();
private:
PyObject *_key;
SALOME::PickelizedPyObjRdWrServer_ptr getVar();
public:
void prepareRollBackInCaseOfFailure();
- void perform();
- void rollBack();
- void notify();
+ void perform() override;
+ void rollBack() override;
+ void notify() override;
};
/*!
public://remotely callable
void addKeyValueInVarErrorIfAlreadyExistingNow(const SALOME::ByteVec& key, const SALOME::ByteVec& value);
public:
- void prepareRollBackInCaseOfFailure();
- void perform();
- void rollBack();
- void notify();
+ void prepareRollBackInCaseOfFailure() override;
+ void perform() override;
+ void rollBack() override;
+ void notify() override;
};
}