template<typename... TFields>
class proto_structs::Oneof< TFields >
Wrapper for oneof protobuf message fields.
- Template Parameters
-
Definition at line 20 of file oneof.hpp.
|
|
constexpr | Oneof ()=default |
| | Creates oneof without any field set.
|
| |
| template<std::size_t Index, typename... TArgs> |
| constexpr | Oneof (std::in_place_index_t< Index > index, TArgs &&... args) |
| | Creates oneof wrapper initializing index field.
|
| |
| constexpr std::size_t | GetIndex () const noexcept |
| | Returns zero-based index of the alternative held by the oneof.
|
| |
| constexpr bool | Contains (std::size_t index) const noexcept |
| | Returns true of oneof contains index field.
|
| |
| constexpr bool | ContainsAny () const noexcept |
| | Returns true of oneof contains some field.
|
| |
| template<std::size_t Index> |
| constexpr const OneofAlternativeType< Index, Oneof > & | Get () const & |
| | Returns Index field.
|
| |
| template<std::size_t Index> |
| constexpr OneofAlternativeType< Index, Oneof > & | Get () & |
| | Returns Index field.
|
| |
| template<std::size_t Index> |
| constexpr OneofAlternativeType< Index, Oneof > && | Get () && |
| | Returns Index field.
|
| |
| template<std::size_t Index, typename... TArgs> |
| constexpr OneofAlternativeType< Index, Oneof > & | Emplace (TArgs &&... args) |
| | Initializes Index field in-place and returns it.
|
| |
| template<std::size_t Index> |
| constexpr void | Set (const OneofAlternativeType< Index, Oneof > &value) |
| |
| template<std::size_t Index> |
| constexpr void | Set (OneofAlternativeType< Index, Oneof > &&value) |
| |
| template<std::size_t Index> |
| constexpr OneofAlternativeType< Index, Oneof > & | GetMutable () |
| | If field at Index is not set, sets it. Returns a mutable reference to the field.
|
| |
| void | Clear (std::size_t index) noexcept |
| | Clear field Index if it is set.
|
| |
| void | ClearOneof () noexcept |
| | Clears oneof.
|
| |
| constexpr | operator bool () const noexcept |
| | Returns true if oneof contains some field.
|
| |
|
bool | operator== (const Oneof &other) const =default |
| | Comparison to another oneof of the same type.
|
| |