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

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

Unsigned owner-local generation type.

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

◆ index_type

Unsigned owner-local slot index type.

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

成员函数说明

◆ bumpedGeneration()

constexpr std::optional< generation_type > eve::detail::HandleCoordinates::bumpedGeneration ( ) const
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().

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

◆ fromPacked()

static constexpr HandleCoordinates eve::detail::HandleCoordinates::fromPacked ( std::uint64_t  value)
inlinestaticconstexprnoexcept

Reconstructs coordinates from an explicit packed boundary value.

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

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

引用了 value.

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

◆ isInvalid()

constexpr bool eve::detail::HandleCoordinates::isInvalid ( ) const
inlineconstexprnoexcept

Returns whether this value is the invalid sentinel.

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

引用了 isValid().

被这些函数引用 eve::RuntimeHandle< Tag >::isInvalid().

◆ isValid()

constexpr bool eve::detail::HandleCoordinates::isValid ( ) const
inlineconstexprnoexcept

Returns whether both coordinates are usable handle values.

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

引用了 generation, index, invalidGeneration , 以及 invalidIndex.

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

◆ nextGeneration()

static constexpr std::optional< generation_type > eve::detail::HandleCoordinates::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 第 59 行定义.

引用了 current.

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

◆ packed()

constexpr std::uint64_t eve::detail::HandleCoordinates::packed ( ) const
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<=>

constexpr auto operator<=> ( const HandleCoordinates &  ,
const HandleCoordinates &   
)
friend

Operator <=>.

◆ operator==

constexpr bool operator== ( const HandleCoordinates &  ,
const HandleCoordinates &   
)
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

◆ invalidGeneration

constexpr generation_type eve::detail::HandleCoordinates::invalidGeneration = 0
staticconstexpr

Reserved generation value shared by all invalid handles.

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

被这些函数引用 isValid().

◆ invalidIndex

constexpr index_type eve::detail::HandleCoordinates::invalidIndex = std::numeric_limits<index_type>::max()
staticconstexpr

Reserved index value shared by all invalid handles.

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

被这些函数引用 bumpedGeneration() , 以及 isValid().


该结构体的文档由以下文件生成: