diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2020-07-22 22:13:33 +0200 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2020-07-22 22:40:34 +0200 |
commit | 90021e1d335efac1017562c1d5dee43e99580319 (patch) | |
tree | 2a6c70ab6664085f5a86f210ac63cb064c9cb5c8 /src/identity.cpp | |
parent | 8ac21c24e49bc3702c55d1c796f969f1d1f6128b (diff) |
Local and shared state
Diffstat (limited to 'src/identity.cpp')
-rw-r--r-- | src/identity.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/identity.cpp b/src/identity.cpp index 2396b9f..7364a8b 100644 --- a/src/identity.cpp +++ b/src/identity.cpp @@ -11,6 +11,8 @@ using std::nullopt; using std::runtime_error; using std::set; +const UUID Identity::sharedTypeId { "0c6c1fe0-f2d7-4891-926b-c332449f7871" }; + Identity::Identity(const Priv * p): p(p) {} Identity::Identity(shared_ptr<const Priv> && p): p(std::move(p)) {} @@ -32,6 +34,15 @@ optional<Identity> Identity::load(const vector<Ref> & refs) return nullopt; } +vector<Ref> Identity::store(const Storage & st) const +{ + vector<Ref> res; + res.reserve(p->data.size()); + for (const auto & x : p->data) + res.push_back(x.store(st)); + return res; +} + optional<string> Identity::name() const { return p->name.get(); |