载入中...
搜索中...
未找到

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 <=>.
 

详细描述

template<typename Tag>
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.

模板参数
TagAn empty owner-specific tag; different tags are never implicitly interchangeable.

RuntimeHandle public API.

在文件 RuntimeHandle.h 第 116 行定义.

成员类型定义说明

◆ generation_type

template<typename Tag >
using eve::RuntimeHandle< Tag >::generation_type = detail::HandleCoordinates::generation_type

Unsigned owner-local generation type.

在文件 RuntimeHandle.h 第 121 行定义.

◆ index_type

template<typename Tag >
using eve::RuntimeHandle< Tag >::index_type = detail::HandleCoordinates::index_type

Unsigned owner-local slot index type.

在文件 RuntimeHandle.h 第 119 行定义.

构造及析构函数说明

◆ RuntimeHandle() [1/2]

template<typename Tag >
constexpr eve::RuntimeHandle< Tag >::RuntimeHandle ( )
constexprdefaultnoexcept

Constructs an invalid handle.

被这些函数引用 eve::RuntimeHandle< Tag >::fromPacked() , 以及 eve::RuntimeHandle< Tag >::nextGeneration().

◆ RuntimeHandle() [2/2]

template<typename Tag >
constexpr eve::RuntimeHandle< Tag >::RuntimeHandle ( index_type  index,
generation_type  generation 
)
inlineexplicitconstexprnoexcept

Constructs a handle from its exact slot coordinates.

参数
indexOwner-local slot index.
generationOwner-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()

template<typename Tag >
static constexpr RuntimeHandle eve::RuntimeHandle< Tag >::fromPacked ( std::uint64_t  value)
inlinestaticconstexprnoexcept

Reconstructs a handle from an explicit packed boundary value.

参数
valueValue previously produced by packed().
返回
The decoded handle; invalid coordinate values remain invalid.

Constructs a RuntimeHandle.

在文件 RuntimeHandle.h 第 190 行定义.

引用了 eve::detail::HandleCoordinates::fromPacked(), eve::RuntimeHandle< Tag >::RuntimeHandle() , 以及 value.

被这些函数引用 eve::climbing::ClimbingRuntime::restore().

◆ generation()

template<typename Tag >
constexpr generation_type eve::RuntimeHandle< Tag >::generation ( ) const
inlineconstexprnoexcept

◆ index()

template<typename Tag >
constexpr index_type eve::RuntimeHandle< Tag >::index ( ) const
inlineconstexprnoexcept

◆ invalid()

template<typename Tag >
static constexpr RuntimeHandle eve::RuntimeHandle< Tag >::invalid ( )
inlinestaticconstexprnoexcept

Returns the canonical invalid handle.

在文件 RuntimeHandle.h 第 143 行定义.

◆ isInvalid()

template<typename Tag >
constexpr bool eve::RuntimeHandle< Tag >::isInvalid ( ) const
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()

◆ nextGeneration() [1/2]

template<typename Tag >
constexpr std::optional< RuntimeHandle > eve::RuntimeHandle< Tag >::nextGeneration ( ) const
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]

template<typename Tag >
static constexpr std::optional< generation_type > eve::RuntimeHandle< Tag >::nextGeneration ( generation_type  current)
inlinestaticconstexprnoexcept

Returns the next generation without unsigned wraparound.

参数
currentThe current slot generation.
返回
The next generation, or empty when the slot must be retired.

在文件 RuntimeHandle.h 第 162 行定义.

引用了 current , 以及 eve::detail::HandleCoordinates::nextGeneration().

◆ packed()

template<typename Tag >
constexpr std::uint64_t eve::RuntimeHandle< Tag >::packed ( ) const
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<=>

template<typename Tag >
constexpr auto operator<=> ( const RuntimeHandle< Tag > &  left,
const RuntimeHandle< Tag > &  right 
)
friend

Operator <=>.

在文件 RuntimeHandle.h 第 201 行定义.

◆ operator==

template<typename Tag >
constexpr bool operator== ( const RuntimeHandle< Tag > &  left,
const RuntimeHandle< Tag > &  right 
)
friend

Operator ==.

在文件 RuntimeHandle.h 第 197 行定义.

类成员变量说明

◆ invalidGeneration

template<typename Tag >
constexpr generation_type eve::RuntimeHandle< Tag >::invalidGeneration = detail::HandleCoordinates::invalidGeneration
staticconstexpr

Reserved generation value shared by all invalid handles.

在文件 RuntimeHandle.h 第 126 行定义.

◆ invalidIndex

template<typename Tag >
constexpr index_type eve::RuntimeHandle< Tag >::invalidIndex = detail::HandleCoordinates::invalidIndex
staticconstexpr

Reserved index value shared by all invalid handles.

在文件 RuntimeHandle.h 第 124 行定义.


该类的文档由以下文件生成: