|
template<U Low, U High, typename... Args> |
static constexpr U | each_enum_range (U last_value, Args... args) |
| Iterates over the range [Low, High] of enum values between Low and High.
|
|
template<U Low, U High, typename... Args> |
static constexpr U | each_mask_range (U last_value, Args... args) |
| Iterates over the mask range (Low, High] of enum values between Low and High.
|
|
template<U Value = static_cast<U>(_::to_constant< E , 126>::value), typename... Args> |
static constexpr U | each_enum (Args... args) |
| Handles enum iteration for gathering reflection data.
|
|
template<typename E, typename Handler>
struct flecs::_::enum_reflection< E, Handler >
Provides utilities for enum reflection.
This struct provides static functions for enum reflection, including conversion between enum values and their underlying integral types, and iteration over enum values.
- Template Parameters
-
E | The enum type. |
Handler | The handler for enum reflection operations. |
Definition at line 193 of file enum.hpp.
template<typename E , typename Handler >
template<U Value = static_cast<U>(_::to_constant< E , 126>::value), typename... Args>
Handles enum iteration for gathering reflection data.
Iterates over all enum values up to a specified maximum value (each_enum_range<0, Value>), then iterates the rest of the possible bitmasks (each_mask_range<Value, high_bit>).
- Template Parameters
-
Value | The maximum enum value to iterate up to. |
Args | Additional arguments to be passed through to Handler::handle_constant |
- Parameters
-
args | Additional arguments to be passed through to Handler::handle_constant |
- Returns
- constexpr U The result of the iteration.
Definition at line 260 of file enum.hpp.
template<typename E , typename Handler >
template<U Low, U High, typename... Args>
Iterates over the range [Low, High] of enum values between Low and High.
Recursively divide and conquers the search space to reduce the template-depth. Once recursive division is complete, calls Handle<E>::handle_constant in ascending order, passing the values computed up the chain.
- Template Parameters
-
Low | The lower bound of the search range, inclusive. |
High | The upper bound of the search range, inclusive. |
Args | Additional arguments to be passed through to Handler::handle_constant |
- Parameters
-
last_value | The last value processed in the iteration. |
args | Additional arguments to be passed through to Handler::handle_constant |
- Returns
- constexpr U The result of the iteration.
Definition at line 211 of file enum.hpp.
template<typename E , typename Handler >
template<U Low, U High, typename... Args>
Iterates over the mask range (Low, High] of enum values between Low and High.
Recursively iterates the search space, looking for enums defined as multiple-of-2 bitmasks. Each iteration, shifts bit to the right until it hits Low, then calls Handler::handle_constant for each bitmask in ascending order.
- Template Parameters
-
Low | The lower bound of the search range, not inclusive |
High | The upper bound of the search range, inclusive. |
Args | Additional arguments to be passed through to Handler::handle_constant |
- Parameters
-
last_value | The last value processed in the iteration. |
args | Additional arguments to be passed through to Handler::handle_constant |
- Returns
- constexpr U The result of the iteration.
Definition at line 237 of file enum.hpp.