From 567156b05183cc63aedbf57c03f26e0eaf43a39e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Tue, 27 Apr 2021 22:59:52 +0200 Subject: SharedState type and lens --- src/state.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src/state.h') 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 lookup(UUID) const; + + vector> tip; +}; + struct LocalState::Priv { optional identity; - vector> shared; + SharedState::Priv shared; }; -struct SharedState +struct SharedData { - explicit SharedState(vector> prev, + explicit SharedData(vector> prev, UUID type, vector 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> prev; + vector> prev; UUID type; vector value; }; -- cgit v1.2.3