summaryrefslogtreecommitdiff
path: root/src/state.h
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2020-07-22 22:13:33 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2020-07-22 22:40:34 +0200
commit90021e1d335efac1017562c1d5dee43e99580319 (patch)
tree2a6c70ab6664085f5a86f210ac63cb064c9cb5c8 /src/state.h
parent8ac21c24e49bc3702c55d1c796f969f1d1f6128b (diff)
Local and shared state
Diffstat (limited to 'src/state.h')
-rw-r--r--src/state.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/state.h b/src/state.h
new file mode 100644
index 0000000..d2c89fc
--- /dev/null
+++ b/src/state.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <erebos/state.h>
+
+#include "pubkey.h"
+
+using std::optional;
+using std::vector;
+
+namespace erebos {
+
+struct LocalState::Priv
+{
+ optional<Identity> identity;
+ vector<Stored<struct SharedState>> shared;
+};
+
+struct SharedState
+{
+ explicit SharedState(vector<Stored<SharedState>> prev,
+ UUID type, vector<Ref> value):
+ prev(prev), type(type), value(value) {}
+ explicit SharedState(const Ref &);
+ static SharedState load(const Ref & ref) { return SharedState(ref); }
+ Ref store(const Storage &) const;
+
+ vector<Stored<SharedState>> prev;
+ UUID type;
+ vector<Ref> value;
+};
+
+}