blob: 4fdddab0a4c804ba3c2a1e818a2922af993a942f (
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
33
34
35
36
37
38
39
40
41
42
43
44
45
|
#pragma once
#include <erebos/storage.h>
namespace erebos {
class Identity
{
public:
static std::optional<Identity> load(const Ref &);
static std::optional<Identity> load(const std::vector<Ref> &);
std::optional<std::string> name() const;
std::optional<Identity> owner() const;
Stored<class PublicKey> keyMessage() const;
std::optional<Ref> ref() const;
class Builder
{
public:
Identity commit() const;
void name(const std::string &);
void owner(const Identity &);
private:
friend class Identity;
struct Priv;
const std::shared_ptr<Priv> p;
Builder(Priv * p): p(p) {}
};
static Builder create(const Storage &);
Builder modify() const;
private:
struct Priv;
const std::shared_ptr<const Priv> p;
Identity(const Priv * p): p(p) {}
Identity(std::shared_ptr<const Priv> && p): p(std::move(p)) {}
};
}
|