#include "model/Role.hpp" #include #include "spec/WireEnums.hpp" namespace dp { const std::array& Role::all() { static const std::array values = {Role(Role::Public), Role(Role::Member)}; return values; } const char* Role::raw() const { return spec::WireEnums::kRole[static_cast(value_)]; } std::optional Role::fromRaw(const std::string& raw) { for (const auto& v : all()) { if (raw == v.raw()) return v; } return std::nullopt; } } // namespace dp