summaryrefslogtreecommitdiff
path: root/src/state.h
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2021-04-27 22:59:52 +0200
committerRoman Smrž <roman.smrz@seznam.cz>2021-05-08 13:23:34 +0200
commit567156b05183cc63aedbf57c03f26e0eaf43a39e (patch)
tree56e4ebf2199bd9539222515885f74856de82459c /src/state.h
parenta511d2d1ef5fa07dde601961fe9394b474aad5ae (diff)
SharedState type and lens
Diffstat (limited to 'src/state.h')
-rw-r--r--src/state.h20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/state.h b/src/state.h
index d2c89fc..91dea94 100644
--- a/src/state.h
+++ b/src/state.h
@@ -5,26 +5,34 @@
#include "pubkey.h"
using std::optional;
+using std::shared_ptr;
using std::vector;
namespace erebos {
+struct SharedState::Priv
+{
+ vector<Ref> lookup(UUID) const;
+
+ vector<Stored<struct SharedData>> tip;
+};
+
struct LocalState::Priv
{
optional<Identity> identity;
- vector<Stored<struct SharedState>> shared;
+ SharedState::Priv shared;
};
-struct SharedState
+struct SharedData
{
- explicit SharedState(vector<Stored<SharedState>> prev,
+ explicit SharedData(vector<Stored<SharedData>> 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); }
+ explicit SharedData(const Ref &);
+ static SharedData load(const Ref & ref) { return SharedData(ref); }
Ref store(const Storage &) const;
- vector<Stored<SharedState>> prev;
+ vector<Stored<SharedData>> prev;
UUID type;
vector<Ref> value;
};