Process-local slot identity tagged by the registry that owns it. 更多...
#include <RuntimeHandle.h>
Public 类型 | |
| using | index_type = detail::HandleCoordinates::index_type |
| Unsigned owner-local slot index type. | |
| using | generation_type = detail::HandleCoordinates::generation_type |
| Unsigned owner-local generation type. | |
Public 成员函数 | |
| constexpr | RuntimeHandle () noexcept=default |
| Constructs an invalid handle. | |
| constexpr | RuntimeHandle (index_type index, generation_type generation) noexcept |
| Constructs a handle from its exact slot coordinates. | |
| 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 index_type | index () const noexcept |
| Returns the owner-local slot index. | |
| constexpr generation_type | generation () const noexcept |
| Returns the owner-local replacement generation. | |
| constexpr std::optional< RuntimeHandle > | nextGeneration () const noexcept |
| Returns this slot at its next generation. | |
| constexpr std::uint64_t | packed () const noexcept |
| Encodes the two coordinates for a legacy integer boundary. | |
静态 Public 成员函数 | |
| static constexpr RuntimeHandle | invalid () noexcept |
| Returns the canonical invalid handle. | |
| static constexpr std::optional< generation_type > | nextGeneration (generation_type current) noexcept |
| Returns the next generation without unsigned wraparound. | |
| static constexpr RuntimeHandle | fromPacked (std::uint64_t value) noexcept |
| Reconstructs a handle from an explicit packed boundary value. | |
静态 Public 属性 | |
| static constexpr index_type | invalidIndex = detail::HandleCoordinates::invalidIndex |
| Reserved index value shared by all invalid handles. | |
| static constexpr generation_type | invalidGeneration = detail::HandleCoordinates::invalidGeneration |
| Reserved generation value shared by all invalid handles. | |
友元 | |
| constexpr bool | operator== (const RuntimeHandle &left, const RuntimeHandle &right) noexcept |
| Operator ==. | |
| constexpr auto | operator<=> (const RuntimeHandle &left, const RuntimeHandle &right) noexcept |
| Operator <=>. | |
详细描述
class eve::RuntimeHandle< Tag >
Process-local slot identity tagged by the registry that owns it.
A handle is current only while its owner has an occupied slot at index() whose generation equals generation(). Generation zero and the all-ones index are reserved for invalid values. Owners must start live slots at generation one, increment the generation on destruction before a slot is reused, and retire a slot instead of wrapping at the generation limit. A handle is therefore stale after destruction, even if its slot is later reused for another object.
- 模板参数
-
Tag An empty owner-specific tag; different tags are never implicitly interchangeable.
RuntimeHandle public API.
在文件 RuntimeHandle.h 第 116 行定义.
成员类型定义说明
◆ generation_type
| using eve::RuntimeHandle< Tag >::generation_type = detail::HandleCoordinates::generation_type |
Unsigned owner-local generation type.
在文件 RuntimeHandle.h 第 121 行定义.
◆ index_type
| using eve::RuntimeHandle< Tag >::index_type = detail::HandleCoordinates::index_type |
Unsigned owner-local slot index type.
在文件 RuntimeHandle.h 第 119 行定义.
构造及析构函数说明
◆ RuntimeHandle() [1/2]
|
constexprdefaultnoexcept |
Constructs an invalid handle.
被这些函数引用 eve::RuntimeHandle< Tag >::fromPacked() , 以及 eve::RuntimeHandle< Tag >::nextGeneration().
◆ RuntimeHandle() [2/2]
|
inlineexplicitconstexprnoexcept |
Constructs a handle from its exact slot coordinates.
- 参数
-
index Owner-local slot index. generation Owner-local generation; zero is invalid.
- 备注
- This constructor does not prove that the owner currently has a live object at the coordinates. Resolution is the owner's responsibility.
在文件 RuntimeHandle.h 第 139 行定义.
引用了 eve::RuntimeHandle< Tag >::generation() , 以及 eve::RuntimeHandle< Tag >::index().
成员函数说明
◆ fromPacked()
|
inlinestaticconstexprnoexcept |
Reconstructs a handle from an explicit packed boundary value.
- 返回
- The decoded handle; invalid coordinate values remain invalid.
Constructs a RuntimeHandle.
在文件 RuntimeHandle.h 第 190 行定义.
引用了 eve::detail::HandleCoordinates::fromPacked(), eve::RuntimeHandle< Tag >::RuntimeHandle() , 以及 value.
◆ generation()
|
inlineconstexprnoexcept |
Returns the owner-local replacement generation.
在文件 RuntimeHandle.h 第 155 行定义.
引用了 eve::detail::HandleCoordinates::generation.
被这些函数引用 eve::asset_graphics::VegetationSceneElementHandle::generation(), eve::graphics::PrimitiveHandle::generation() , 以及 eve::RuntimeHandle< Tag >::RuntimeHandle().
◆ index()
|
inlineconstexprnoexcept |
Returns the owner-local slot index.
在文件 RuntimeHandle.h 第 152 行定义.
引用了 eve::detail::HandleCoordinates::index.
被这些函数引用 eve::physics::World3D::destroy(), eve::asset_graphics::VegetationSceneElementHandle::index(), eve::graphics::PrimitiveHandle::index() , 以及 eve::RuntimeHandle< Tag >::RuntimeHandle().
◆ invalid()
|
inlinestaticconstexprnoexcept |
Returns the canonical invalid handle.
在文件 RuntimeHandle.h 第 143 行定义.
◆ isInvalid()
|
inlineconstexprnoexcept |
Returns whether this value is the invalid sentinel.
在文件 RuntimeHandle.h 第 149 行定义.
引用了 eve::detail::HandleCoordinates::isInvalid().
被这些函数引用 eve::physics::PhysicsLink::attach(), eve::stylize::MeshEffectInstance::bindTarget() , 以及 eve::physics::World3D::rayCastOwned().
◆ isValid()
|
inlineconstexprnoexcept |
Returns whether both coordinates are usable handle values.
在文件 RuntimeHandle.h 第 146 行定义.
引用了 eve::detail::HandleCoordinates::isValid().
被这些函数引用 eve::climbing::ClimbingAnchorGraphInstance::bind(), eve::physics::PhysicsArtifactProvider::bindWorld(), eve::npc_ai::SmartObjectWorld::claim(), eve::physics::World::forgetJoint(), eve::physics::World3D::forgetJoint(), eve::physics::PhysicsLink::fromBody(), eve::physics::PhysicsLink::fromBody(), eve::physics::PhysicsJointLink::fromJoint(), eve::physics::PhysicsShapeLink::fromShape(), eve::asset_graphics::VegetationSceneElementHandle::isValid(), eve::graphics::PrimitiveHandle::isValid(), eve::physics::PhysicsShapeLink::isValid(), eve::physics::PhysicsJointLink::isValid(), eve::physics::PhysicsArtifactProvider::prepare(), eve::npc_ai::NpcAgentState::releaseAgent() , 以及 eve::npc_ai::SmartObjectWorld::releaseAgentClaims().
◆ nextGeneration() [1/2]
|
inlineconstexprnoexcept |
Returns this slot at its next generation.
- 返回
- A bumped handle, or empty for an invalid index or overflow.
Constructs a RuntimeHandle.
在文件 RuntimeHandle.h 第 170 行定义.
引用了 eve::detail::HandleCoordinates::bumpedGeneration(), eve::detail::HandleCoordinates::index , 以及 eve::RuntimeHandle< Tag >::RuntimeHandle().
◆ nextGeneration() [2/2]
|
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 第 162 行定义.
引用了 current , 以及 eve::detail::HandleCoordinates::nextGeneration().
◆ packed()
|
inlineconstexprnoexcept |
Encodes the two coordinates for a legacy integer boundary.
- 返回
- A lossless process-local packed representation.
- 备注
- This is an explicit projection only; it is not an integer conversion operator and must not be used as a persistent ID.
在文件 RuntimeHandle.h 第 183 行定义.
引用了 eve::detail::HandleCoordinates::packed().
被这些函数引用 eve::ui::DatabasePanel::build() , 以及 eve::physics::detail::makePhysicsWorldPersistentId().
友元及相关函数文档
◆ operator<=>
|
friend |
Operator <=>.
在文件 RuntimeHandle.h 第 201 行定义.
◆ operator==
|
friend |
Operator ==.
在文件 RuntimeHandle.h 第 197 行定义.
类成员变量说明
◆ invalidGeneration
|
staticconstexpr |
Reserved generation value shared by all invalid handles.
在文件 RuntimeHandle.h 第 126 行定义.
◆ invalidIndex
|
staticconstexpr |
Reserved index value shared by all invalid handles.
在文件 RuntimeHandle.h 第 124 行定义.
该类的文档由以下文件生成:
- src/engine/common/RuntimeHandle.h