From 90021e1d335efac1017562c1d5dee43e99580319 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Wed, 22 Jul 2020 22:13:33 +0200 Subject: Local and shared state --- src/state.h | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/state.h (limited to 'src/state.h') 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 + +#include "pubkey.h" + +using std::optional; +using std::vector; + +namespace erebos { + +struct LocalState::Priv +{ + optional identity; + vector> shared; +}; + +struct SharedState +{ + explicit SharedState(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); } + Ref store(const Storage &) const; + + vector> prev; + UUID type; + vector value; +}; + +} -- cgit v1.2.3