MySQL 9.1.0
Source Code Documentation
|
std::optional-like wrapper for simple bitmaps (usually enums of binary flags) More...
#include <parser_yystype.h>
Public Member Functions | |
void | init () |
Constructor-like function. More... | |
bool | is_set () const |
False if the wrapped Enum value is not assigned. More... | |
Enum | get () const |
Return the wrapped Enum value. More... | |
Enum | get_or_default () const |
Return the wrapped Enum value (if any) or the Default_value. More... | |
void | set (Enum value) |
Assign the wrapped Enum value. More... | |
void | merge (const Enum_parser &x) |
Merge the x bit set into the wrapped Enum value (if any), or replace it. More... | |
Private Attributes | |
bool | m_is_set |
True if m_enum is assigned with some value. More... | |
Enum | m_enum |
The wrapped Enum value. More... | |
std::optional-like wrapper for simple bitmaps (usually enums of binary flags)
This template wraps trivial bitmap implementations to add two features:
std::optional-like behavior – the "unset" flag, so we don't have to inject a special "invalid" value into existent enum types, this wrapper class does that for us.
the merge() function to merge two bitmap values in a type-safe way.
Enum | Usually a enum type which simulates a bit set. |
Default_value | A default Enum value for "unset" variables. |
|
inline |
Return the wrapped Enum value.
|
inline |
Return the wrapped Enum value (if any) or the Default_value.
|
inline |
Constructor-like function.
The Enum_parser<> class is designed for use as a field of restricted unions, so it can't have C++ constructors.
|
inline |
False if the wrapped Enum value is not assigned.
|
inline |
Merge the x bit set into the wrapped Enum value (if any), or replace it.
|
inline |
Assign the wrapped Enum value.
|
private |
The wrapped Enum value.
|
private |
True if m_enum is assigned with some value.