Tag-free slot coordinates behind every RuntimeHandle<Tag>.
更多...
#include <RuntimeHandle.h>
Public 类型 | |
| using | index_type = std::uint32_t |
| Unsigned owner-local slot index type. | |
| using | generation_type = std::uint32_t |
| Unsigned owner-local generation type. | |
Public 成员函数 | |
| constexpr bool | isValid () const noexcept |
| Returns whether both coordinates are usable handle values. | |
| constexpr bool | isInvalid () const noexcept |
| Returns whether this value is the invalid sentinel. | |
| constexpr std::optional< generation_type > | bumpedGeneration () const noexcept |
| Returns this slot's next generation. | |
| constexpr std::uint64_t | packed () const noexcept |
| Encodes the two coordinates for a legacy integer boundary. | |
静态 Public 成员函数 | |
| static constexpr std::optional< generation_type > | nextGeneration (generation_type current) noexcept |
| Returns the next generation without unsigned wraparound. | |
| static constexpr HandleCoordinates | fromPacked (std::uint64_t value) noexcept |
| Reconstructs coordinates from an explicit packed boundary value. | |
Public 属性 | |
| index_type | index = invalidIndex |
| generation_type | generation = invalidGeneration |
静态 Public 属性 | |
| static constexpr index_type | invalidIndex = std::numeric_limits<index_type>::max() |
| Reserved index value shared by all invalid handles. | |
| static constexpr generation_type | invalidGeneration = 0 |
| Reserved generation value shared by all invalid handles. | |
友元 | |
| constexpr bool | operator== (const HandleCoordinates &, const HandleCoordinates &) noexcept=default |
| Operator ==. | |
| constexpr auto | operator<=> (const HandleCoordinates &, const HandleCoordinates &) noexcept=default |
| Operator <=>. | |
详细描述
Tag-free slot coordinates behind every RuntimeHandle<Tag>.
Validity, generation bumping without unsigned wraparound and the packed projection are identical for every owner tag, so they are defined once here. RuntimeHandle<Tag> keeps the tag purely as a phantom type and inherits nothing, so comparing handles of different tags still does not compile.
在文件 RuntimeHandle.h 第 32 行定义.
成员类型定义说明
◆ generation_type
| using eve::detail::HandleCoordinates::generation_type = std::uint32_t |
Unsigned owner-local generation type.
在文件 RuntimeHandle.h 第 36 行定义.
◆ index_type
| using eve::detail::HandleCoordinates::index_type = std::uint32_t |
Unsigned owner-local slot index type.
在文件 RuntimeHandle.h 第 34 行定义.
成员函数说明
◆ bumpedGeneration()
|
inlineconstexprnoexcept |
Returns this slot's next generation.
- 返回
- The bumped generation, or empty for an invalid index or overflow.
Next generation.
在文件 RuntimeHandle.h 第 68 行定义.
引用了 generation, index, invalidIndex , 以及 nextGeneration().
◆ fromPacked()
|
inlinestaticconstexprnoexcept |
Reconstructs coordinates from an explicit packed boundary value.
- 返回
- The decoded coordinates; invalid coordinate values remain invalid.
在文件 RuntimeHandle.h 第 87 行定义.
引用了 value.
◆ isInvalid()
|
inlineconstexprnoexcept |
◆ isValid()
|
inlineconstexprnoexcept |
Returns whether both coordinates are usable handle values.
在文件 RuntimeHandle.h 第 47 行定义.
引用了 generation, index, invalidGeneration , 以及 invalidIndex.
被这些函数引用 isInvalid() , 以及 eve::RuntimeHandle< Tag >::isValid().
◆ nextGeneration()
|
inlinestaticconstexprnoexcept |
Returns the next generation without unsigned wraparound.
- 参数
-
current The current slot generation.
- 返回
- The next generation, or empty when the slot must be retired.
在文件 RuntimeHandle.h 第 59 行定义.
引用了 current.
被这些函数引用 bumpedGeneration() , 以及 eve::RuntimeHandle< Tag >::nextGeneration().
◆ packed()
|
inlineconstexprnoexcept |
Encodes the two coordinates for a legacy integer boundary.
- 返回
- A lossless process-local packed representation.
在文件 RuntimeHandle.h 第 78 行定义.
引用了 generation , 以及 index.
被这些函数引用 eve::RuntimeHandle< Tag >::packed().
友元及相关函数文档
◆ operator<=>
|
friend |
Operator <=>.
◆ operator==
|
friend |
Operator ==.
类成员变量说明
◆ generation
| generation_type eve::detail::HandleCoordinates::generation = invalidGeneration |
在文件 RuntimeHandle.h 第 44 行定义.
被这些函数引用 bumpedGeneration(), eve::RuntimeHandle< Tag >::generation(), isValid() , 以及 packed().
◆ index
| index_type eve::detail::HandleCoordinates::index = invalidIndex |
在文件 RuntimeHandle.h 第 43 行定义.
被这些函数引用 bumpedGeneration(), eve::RuntimeHandle< Tag >::index(), isValid(), eve::RuntimeHandle< Tag >::nextGeneration() , 以及 packed().
◆ invalidGeneration
|
staticconstexpr |
Reserved generation value shared by all invalid handles.
在文件 RuntimeHandle.h 第 41 行定义.
被这些函数引用 isValid().
◆ invalidIndex
|
staticconstexpr |
Reserved index value shared by all invalid handles.
在文件 RuntimeHandle.h 第 39 行定义.
被这些函数引用 bumpedGeneration() , 以及 isValid().
该结构体的文档由以下文件生成:
- src/engine/common/RuntimeHandle.h