#pragma once #include #include namespace erebos { using std::optional; using std::vector; template class Signed; struct IdentityData; struct StoredIdentityPart; class Identity { public: Identity(const Identity &) = default; Identity(Identity &&) = default; Identity & operator=(const Identity &) = default; Identity & operator=(Identity &&) = default; static std::optional load(const Ref &); static std::optional load(const std::vector &); static std::optional load(const std::vector>> &); static std::optional load(const std::vector &); std::vector store() const; std::vector store(const Storage & st) const; vector>> data() const; vector extData() const; std::optional name() const; std::optional owner() const; const Identity & finalOwner() const; Stored keyIdentity() const; Stored keyMessage() const; bool sameAs(const Identity &) const; bool operator==(const Identity & other) const; bool operator!=(const Identity & other) const; std::optional ref() const; std::vector refs() const; std::vector updates() 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 p; Builder(Priv * p); }; static Builder create(const Storage &); Builder modify() const; Identity update(const vector>> &) const; Identity update(const vector &) const; private: struct Priv; std::shared_ptr p; Identity(const Priv * p); Identity(std::shared_ptr && p); }; DECLARE_SHARED_TYPE(optional) }