From 0c8761b3d76912f034a0cb819d72f0349a25bf4f Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 11 May 2018 17:10:39 +0200 Subject: Remove commit, maybe readd it later --- include/odhtdb/Database.hpp | 9 --------- include/odhtdb/StagedObject.hpp | 22 ---------------------- 2 files changed, 31 deletions(-) delete mode 100644 include/odhtdb/StagedObject.hpp (limited to 'include') 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 callbackFunc); void setOnAddNodeCallback(std::function 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); - // Throws CommitAddException on failure - void commitStagedAddObject(const std::unique_ptr &stagedObject); void deserializeCreateRequest(const std::shared_ptr &value, const Hash &hash, const std::shared_ptr encryptionKey); void deserializeAddRequest(const std::shared_ptr &value, const Hash &requestDataHash, const std::shared_ptr &nodeHash, const std::shared_ptr encryptionKey); bool listenCreateData(std::shared_ptr value, const Hash &hash, const std::shared_ptr encryptionKey); bool listenAddData(std::shared_ptr value, const Hash &requestDataHash, const std::shared_ptr nodeHash, const std::shared_ptr encryptionKey); private: dht::DhtRunner node; - std::vector> stagedCreateObjects; - std::vector> stagedAddObjects; DatabaseStorage databaseStorage; std::function onCreateNodeCallbackFunc; std::function 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 requestKey; - - StagedObject(DataView &_data, const std::shared_ptr &_requestKey) : - data(_data), - requestKey(_requestKey) - { - - } - }; -} -- cgit v1.2.3