|
Barretenberg
The ZK-SNARK library at the core of Aztec
|
A wrapper around std::variant that provides msgpack serialization based on type names. More...
#include <named_union.hpp>
Public Types | |
| using | VariantType = std::variant< Types... > |
Public Member Functions | |
| NamedUnion ()=default | |
| template<typename T > requires (std::is_constructible_v<VariantType, T>) | |
| NamedUnion (T &&t) | |
| operator VariantType & () | |
| operator const VariantType & () const | |
| VariantType & | get () |
| const VariantType & | get () const |
| template<typename Visitor > | |
| decltype(auto) | visit (Visitor &&vis) && |
| template<typename Visitor > | |
| decltype(auto) | visit (Visitor &&vis) const & |
| std::string_view | get_type_name () const |
| void | msgpack_pack (auto &packer) const |
| void | msgpack_unpack (msgpack::object const &o) |
| void | msgpack_schema (auto &packer) const |
Static Private Member Functions | |
| template<size_t I = 0> | |
| static std::optional< size_t > | get_index_from_name (std::string_view name) |
| template<size_t I = 0> | |
| static VariantType | construct_by_index (size_t index, auto &o) |
Private Attributes | |
| VariantType | value_ |
A wrapper around std::variant that provides msgpack serialization based on type names.
Each type in the variant must have a static constexpr NAME member that identifies it. During serialization, the NAME is written first, then the object. During deserialization, the NAME is read first to determine which type to construct.
Definition at line 34 of file named_union.hpp.
| using bb::NamedUnion< Types >::VariantType = std::variant<Types...> |
Definition at line 36 of file named_union.hpp.
|
default |
|
inline |
Definition at line 75 of file named_union.hpp.
|
inlinestaticprivate |
Definition at line 55 of file named_union.hpp.
|
inline |
Definition at line 84 of file named_union.hpp.
|
inline |
Definition at line 85 of file named_union.hpp.
|
inlinestaticprivate |
Definition at line 42 of file named_union.hpp.
|
inline |
Definition at line 99 of file named_union.hpp.
|
inline |
Definition at line 107 of file named_union.hpp.
|
inline |
Definition at line 142 of file named_union.hpp.
|
inline |
Definition at line 119 of file named_union.hpp.
|
inline |
Definition at line 81 of file named_union.hpp.
|
inline |
Definition at line 80 of file named_union.hpp.
|
inline |
Definition at line 88 of file named_union.hpp.
|
inline |
Definition at line 93 of file named_union.hpp.
|
private |
Definition at line 39 of file named_union.hpp.