#pragma once #include #include namespace erebos { using std::optional; 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 &); std::vector store() const; std::vector store(const Storage & st) 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; 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; private: struct Priv; std::shared_ptr p; Identity(const Priv * p); Identity(std::shared_ptr && p); }; DECLARE_SHARED_TYPE(optional) }