From 80a9c135b8bdca64246f147f22d98485e0f05ee5 Mon Sep 17 00:00:00 2001 From: Aleksi Lindeman Date: Sun, 28 Jan 2018 07:35:37 +0100 Subject: Add some files... --- include/Database.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 include/Database.hpp (limited to 'include/Database.hpp') diff --git a/include/Database.hpp b/include/Database.hpp new file mode 100644 index 0000000..0b324e8 --- /dev/null +++ b/include/Database.hpp @@ -0,0 +1,31 @@ +#pragma once + +#include "types.hpp" +#include "Key.hpp" +#include "DataView.hpp" +#include +#include + +namespace odhtdb +{ + struct StagedObject + { + Key key; + DataView data; + }; + + class Database + { + public: + Database(const char *bootstrapNodeAddr, u16 port); + ~Database(); + + void add(const Key &key, DataView data); + void commit(); + private: + void commitStagedObject(const StagedObject &stagedObject); + private: + dht::DhtRunner node; + std::vector stagedObjects; + }; +} \ No newline at end of file -- cgit v1.2.3