#pragma once #include namespace erebos { 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 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; 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; static const UUID sharedTypeId; private: struct Priv; std::shared_ptr p; Identity(const Priv * p); Identity(std::shared_ptr && p); }; }