diff options
author | dec05eba <dec05eba@protonmail.com> | 2018-10-21 15:57:36 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2020-08-18 23:25:46 +0200 |
commit | 07f99a86578bee9e7ac0dd0114b89bf983a92d9b (patch) | |
tree | 7b6fd907f14343d66953ab8cca6e674cbc224ed6 /include | |
parent | 0d83a5c6070cd02449571879c5be0c4c441e81b7 (diff) |
Add database object to callback funcs
Diffstat (limited to 'include')
-rw-r--r-- | include/odhtdb/Database.hpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/include/odhtdb/Database.hpp b/include/odhtdb/Database.hpp index 61365a0..ca713bd 100644 --- a/include/odhtdb/Database.hpp +++ b/include/odhtdb/Database.hpp @@ -46,6 +46,8 @@ namespace odhtdb public: DatabaseAddException(const std::string &errMsg) : std::runtime_error(errMsg) {} }; + + class Database; struct DatabaseCreateNodeRequest { @@ -56,13 +58,15 @@ namespace odhtdb const Signature::PublicKey *creatorPublicKey; const DataView groupId; bool loadedFromCache; + const Database *database; - DatabaseCreateNodeRequest(const Hash *_nodeHash, u64 _timestamp, const Signature::PublicKey *_creatorPublicKey, const DataView &_groupId) : + DatabaseCreateNodeRequest(const Hash *_nodeHash, u64 _timestamp, const Signature::PublicKey *_creatorPublicKey, const DataView &_groupId, const Database *_database) : nodeHash(_nodeHash), timestamp(_timestamp), creatorPublicKey(_creatorPublicKey), groupId(_groupId), - loadedFromCache(false) + loadedFromCache(false), + database(_database) { } @@ -78,14 +82,16 @@ namespace odhtdb const Signature::PublicKey *creatorPublicKey; const DataView decryptedData; bool loadedFromCache; + const Database *database; - DatabaseAddNodeRequest(const Hash *_nodeHash, const Hash *_requestHash, u64 _timestamp, const Signature::PublicKey *_creatorPublicKey, const DataView &_decryptedData) : + DatabaseAddNodeRequest(const Hash *_nodeHash, const Hash *_requestHash, u64 _timestamp, const Signature::PublicKey *_creatorPublicKey, const DataView &_decryptedData, const Database *_database) : nodeHash(_nodeHash), requestHash(_requestHash), timestamp(_timestamp), creatorPublicKey(_creatorPublicKey), decryptedData(_decryptedData), - loadedFromCache(false) + loadedFromCache(false), + database(_database) { } @@ -102,15 +108,17 @@ namespace odhtdb const Signature::PublicKey *userToAddPublicKey; const DataView groupToAddUserTo; bool loadedFromCache; + const Database *database; - DatabaseAddUserRequest(const Hash *_nodeHash, const Hash *_requestHash, u64 _timestamp, const Signature::PublicKey *_creatorPublicKey, const Signature::PublicKey *_userToAddPublicKey, const DataView &_groupToAddUserTo) : + DatabaseAddUserRequest(const Hash *_nodeHash, const Hash *_requestHash, u64 _timestamp, const Signature::PublicKey *_creatorPublicKey, const Signature::PublicKey *_userToAddPublicKey, const DataView &_groupToAddUserTo, const Database *_database) : nodeHash(_nodeHash), requestHash(_requestHash), timestamp(_timestamp), creatorPublicKey(_creatorPublicKey), userToAddPublicKey(_userToAddPublicKey), groupToAddUserTo(_groupToAddUserTo), - loadedFromCache(false) + loadedFromCache(false), + database(_database) { } |