|
GREM 3.12.0
Game/Rendering Engine Modules for C++
|
Base class for an opaque handle to a specific element in a Registry. More...
#include <GREM/core/data/Registry.hpp>
Public Types | |
| using | Identifier = uint32_t |
| Underlying value type. | |
| using | Index = uint16_t |
| Index type. | |
| using | Generation = uint16_t |
| Generation counter type. | |
| using | Flags = uint8_t |
| User-defined flags index type. | |
Public Member Functions | |
| constexpr | RegistryElementIDBase () noexcept=default |
| Construct an invalid element handle. | |
| constexpr | RegistryElementIDBase (Index index, Generation generation, Flags flags) |
| Construct an element handle with a specific set of parameters. | |
| constexpr | operator bool () const noexcept |
| Check if this handle is potentially valid. | |
| constexpr Identifier | getIdentifier () const noexcept |
| Get a unique identifier for the underlying representation of the element handle. | |
| constexpr Index | getIndex () const noexcept |
| Get the index of the element's generation slot. | |
| constexpr Generation | getGeneration () const noexcept |
| Get the generation counter value of the element. | |
| constexpr Flags | getFlags () const noexcept |
| Get the user-defined flags of the element. | |
| constexpr bool | operator== (const RegistryElementIDBase &other) const noexcept=default |
| Compare this handle to another for equality. | |
| constexpr std::strong_ordering | operator<=> (const RegistryElementIDBase &other) const noexcept=default |
| Compare this handle to another. | |
Static Public Attributes | |
| static constexpr Index | INVALID_INDEX = Limits<Index>::MAX |
| Reserved index value for an invalid element handle. | |
| static constexpr Index | MAX_INDEX = Limits<Index>::MAX - 1 |
| Maximum valid index value. | |
| static constexpr Generation | MAX_GENERATION = (1 << 14) - 1 |
| Maximum valid generation counter value. | |
| static constexpr Flags | ALL_FLAGS = 0b11 |
| Maximum valid set of user-defined flags. | |
Friends | |
| constexpr bool | operator== (const Self &a, const Self &b) noexcept |
| Compare two handles for equality. | |
| constexpr std::strong_ordering | operator<=> (const Self &a, const Self &b) noexcept |
| Compare two handles. | |
Base class for an opaque handle to a specific element in a Registry.
| Self | CRTP argument for the concrete derived type. |
| using grem::RegistryElementIDBase< Self >::Identifier = uint32_t |
Underlying value type.
| using grem::RegistryElementIDBase< Self >::Index = uint16_t |
Index type.
| using grem::RegistryElementIDBase< Self >::Generation = uint16_t |
Generation counter type.
| using grem::RegistryElementIDBase< Self >::Flags = uint8_t |
User-defined flags index type.
|
constexprdefaultnoexcept |
Construct an invalid element handle.
|
inlineconstexpr |
Construct an element handle with a specific set of parameters.
| index | index of the element's generation slot within the registry. Must be less than or equal to MAX_INDEX. |
| generation | generation counter value of the element. Must be less than or equal to MAX_GENERATION. |
| flags | user-defined flags. Must be less than or equal to ALL_FLAGS. |
|
inlineexplicitconstexprnoexcept |
Check if this handle is potentially valid.
|
inlinenodiscardconstexprnoexcept |
Get a unique identifier for the underlying representation of the element handle.
|
inlinenodiscardconstexprnoexcept |
Get the index of the element's generation slot.
|
inlinenodiscardconstexprnoexcept |
Get the generation counter value of the element.
|
inlinenodiscardconstexprnoexcept |
Get the user-defined flags of the element.
|
nodiscardconstexprdefaultnoexcept |
Compare this handle to another for equality.
| other | the handle to compare this one to. |
|
nodiscardconstexprdefaultnoexcept |
Compare this handle to another.
| other | the handle to compare this one to. |
|
friend |
Compare two handles for equality.
| a | first handle. |
| b | second handle. |
|
friend |
Compare two handles.
| a | first handle. |
| b | second handle. |
|
staticconstexpr |
Reserved index value for an invalid element handle.
|
staticconstexpr |
Maximum valid index value.
|
staticconstexpr |
Maximum valid generation counter value.
|
staticconstexpr |
Maximum valid set of user-defined flags.