summaryrefslogtreecommitdiff
path: root/src/state.h
blob: d2c89fced35de4e95425d0a517a2bdb700ff5949 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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;
};

}