diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-05-11 17:10:39 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | 0c8761b3d76912f034a0cb819d72f0349a25bf4f (patch) | |
tree | 894a8d68f767d21b2239fee662cfb577bd7c988a /include | |
parent | 5e30dd8fd378b0dfb24a67aa75aec1d0902c0243 (diff) |
Remove commit, maybe readd it later
Diffstat (limited to 'include')
-rw-r--r-- | include/odhtdb/Database.hpp | 9 | ||||
-rw-r--r-- | include/odhtdb/StagedObject.hpp | 22 |
2 files changed, 0 insertions, 31 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp index cf24c7e..12c618b 100644 --- a/include/odhtdb/Database.hpp +++ b/include/odhtdb/Database.hpp @@ -6,7 +6,6 @@ #include "DatabaseStorage.hpp" #include "Hash.hpp" #include "utils.hpp" -#include "StagedObject.hpp" #include "Signature.hpp" #include "Permission.hpp" #include "DatabaseNode.hpp" @@ -145,7 +144,6 @@ namespace odhtdb reponseKeyInfoHash = other.reponseKeyInfoHash; } }; - class Database { DISABLE_COPY(Database) @@ -166,7 +164,6 @@ namespace odhtdb void addData(const DatabaseNode &nodeInfo, const LocalUser *userToPerformActionWith, DataView dataToAdd); // Throws PermissionDeniedException if user @userToPerformActionWith is not allowed to add user @userToAdd to group @groupToAddUserTo void addUser(const DatabaseNode &nodeInfo, const LocalUser *userToPerformActionWith, const std::string &userToAddName, const Signature::PublicKey &userToAddPublicKey, Group *groupToAddUserTo); - void commit(); void setOnCreateNodeCallback(std::function<void(const DatabaseCreateNodeRequest&)> callbackFunc); void setOnAddNodeCallback(std::function<void(const DatabaseAddNodeRequest&)> callbackFunc); @@ -175,18 +172,12 @@ namespace odhtdb DatabaseStorage& getStorage(); ntp::NtpTimestamp getSyncedTimestampUtc() const; private: - // Throws CommitCreateException on failure - void commitStagedCreateObject(const std::unique_ptr<StagedObject> &stagedObject); - // Throws CommitAddException on failure - void commitStagedAddObject(const std::unique_ptr<StagedObject> &stagedObject); void deserializeCreateRequest(const std::shared_ptr<dht::Value> &value, const Hash &hash, const std::shared_ptr<OwnedMemory> encryptionKey); void deserializeAddRequest(const std::shared_ptr<dht::Value> &value, const Hash &requestDataHash, const std::shared_ptr<Hash> &nodeHash, const std::shared_ptr<OwnedMemory> encryptionKey); bool listenCreateData(std::shared_ptr<dht::Value> value, const Hash &hash, const std::shared_ptr<OwnedMemory> encryptionKey); bool listenAddData(std::shared_ptr<dht::Value> value, const Hash &requestDataHash, const std::shared_ptr<Hash> nodeHash, const std::shared_ptr<OwnedMemory> encryptionKey); private: dht::DhtRunner node; - std::vector<std::unique_ptr<StagedObject>> stagedCreateObjects; - std::vector<std::unique_ptr<StagedObject>> stagedAddObjects; DatabaseStorage databaseStorage; std::function<void(const DatabaseCreateNodeRequest&)> onCreateNodeCallbackFunc; std::function<void(const DatabaseAddNodeRequest&)> onAddNodeCallbackFunc; diff --git a/include/odhtdb/StagedObject.hpp b/include/odhtdb/StagedObject.hpp deleted file mode 100644 index 0c9b534..0000000 --- a/include/odhtdb/StagedObject.hpp +++ /dev/null @@ -1,22 +0,0 @@ -#pragma once - -#include "utils.hpp" -#include "Hash.hpp" -#include "DataView.hpp" - -namespace odhtdb -{ - struct StagedObject - { - DISABLE_COPY(StagedObject) - DataView data; - std::shared_ptr<Hash> requestKey; - - StagedObject(DataView &_data, const std::shared_ptr<Hash> &_requestKey) : - data(_data), - requestKey(_requestKey) - { - - } - }; -} |