aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authordec05eba <0xdec05eba@gmail.com>2018-10-21 15:57:36 +0200
committerdec05eba <0xdec05eba@gmail.com>2018-10-21 15:57:36 +0200
commit109108c896f1ada76121330ab01602072f32dd8c (patch)
tree64546db690e8edb814053ebcfb3603ff792a0a54 /include
parent22abf1aa83b2668f918556491a55947be798f89f (diff)
Add database object to callback funcs
Diffstat (limited to 'include')
-rw-r--r--include/odhtdb/Database.hpp20
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)
{
}