载入中...
搜索中...
未找到
eve::detail::Id128< Tag > 模板类 参考

Id128 public API. 更多...

#include <Identity.h>

Public 类型

using Bytes = std::array< std::uint8_t, 16 >
 

Public 成员函数

constexpr Id128 () noexcept=default
 Constructs the nil value.
 
constexpr Id128 (Bytes bytes) noexcept
 Constructs an ID from its exact 128-bit representation.
 
std::string format () const
 Formats the ID in lower-case canonical UUID text.
 
constexpr bool isNil () const noexcept
 Returns whether this value is the all-zero nil ID.
 
Id128 child (std::string_view role) const noexcept
 Derives a deterministic child UUID for a hierarchical identity.
 
constexpr Bytes bytes () const noexcept
 Returns the UUID bytes in network order.
 
constexpr std::uint64_t hash () const noexcept
 Returns a stable non-cryptographic hash for hash tables.
 

静态 Public 成员函数

template<typename OtherTag >
static constexpr Id128 fromUuid (const Id128< OtherTag > &value) noexcept
 Re-tags an existing UUID at an explicit domain boundary.
 
static constexpr Id128 nil () noexcept
 Returns the all-zero nil value.
 
static std::optional< Id128 > parse (std::string_view text) noexcept
 Parses canonical UUID text.
 
static std::optional< Id128 > fromBytes (std::span< const std::uint8_t > bytes) noexcept
 Constructs an ID from exactly 16 bytes.
 

友元

constexpr bool operator== (const Id128 &, const Id128 &) noexcept=default
 Operator ==.
 
constexpr auto operator<=> (const Id128 &lhs, const Id128 &rhs) noexcept
 Orders UUID bytes in network order for ordered containers.
 

详细描述

template<typename Tag>
class eve::detail::Id128< Tag >

Id128 public API.

在文件 Identity.h 第 112 行定义.

成员类型定义说明

◆ Bytes

template<typename Tag >
using eve::detail::Id128< Tag >::Bytes = std::array<std::uint8_t, 16>

在文件 Identity.h 第 114 行定义.

构造及析构函数说明

◆ Id128() [1/2]

template<typename Tag >
constexpr eve::detail::Id128< Tag >::Id128 ( )
constexprdefaultnoexcept

◆ Id128() [2/2]

template<typename Tag >
constexpr eve::detail::Id128< Tag >::Id128 ( Bytes  bytes)
inlineexplicitconstexprnoexcept

Constructs an ID from its exact 128-bit representation.

参数
bytesThe bytes in UUID network order (most significant byte first).

在文件 Identity.h 第 123 行定义.

成员函数说明

◆ bytes()

template<typename Tag >
constexpr Bytes eve::detail::Id128< Tag >::bytes ( ) const
inlineconstexprnoexcept

Returns the UUID bytes in network order.

返回
A copy of the owned 128-bit representation.

在文件 Identity.h 第 202 行定义.

被这些函数引用 eve::detail::Id128< Tag >::fromBytes() , 以及 eve::detail::Id128< Tag >::parse().

◆ child()

template<typename Tag >
Id128 eve::detail::Id128< Tag >::child ( std::string_view  role) const
inlinenoexcept

Derives a deterministic child UUID for a hierarchical identity.

参数
roleNon-empty, caller-canonicalized role or child key.
返回
A stable child identity, or nil for a nil parent or empty role.
备注
This is a namespace derivation operation. It is not a source of new instance entropy; use UUIDv7 generation for top-level identities. The operation is kept in the common UUID type so compatibility aliases cannot grow a second identity algorithm.

Constructs a Id128.

在文件 Identity.h 第 192 行定义.

引用了 eve::detail::childUuidBytes(), eve::detail::Id128< Tag >::Id128(), eve::detail::Id128< Tag >::isNil() , 以及 eve::detail::Id128< Tag >::nil().

被这些函数引用 eve::asset_import::bindUnityRenderers(), eve::asset_import::prepareCanonicalTerrainImport(), eve::asset_import::prepareGltfImport(), eve::asset_procgen::prepareGtsTerrainLodPackage(), eve::asset_import::prepareImageImport(), eve::asset_import::prepareLegacyAnimationImport(), eve::asset_stylize::prepareMeshVfxPackage(), eve::asset_import::prepareShaderImport(), eve::asset_import::prepareUnityNativeMesh(), eve::asset_import::prepareUnityNativeTexture(), eve::asset_import::prepareUnityNativeVolumeTexture(), eve::asset_import::prepareUnitySpriteAnimation(), eve::asset_import::prepareUnityVegetationMaterial(), eve::asset_import::prepareUnityVegetationPreset() , 以及 eve::asset_import::prepareUnityVegetationScene().

◆ format()

◆ fromBytes()

template<typename Tag >
static std::optional< Id128 > eve::detail::Id128< Tag >::fromBytes ( std::span< const std::uint8_t >  bytes)
inlinestaticnoexcept

Constructs an ID from exactly 16 bytes.

参数
bytesThe bytes in UUID network order.
返回
The ID, or empty when the span is not exactly 16 bytes.

Constructs a Id128.

在文件 Identity.h 第 161 行定义.

引用了 eve::detail::Id128< Tag >::bytes() , 以及 eve::detail::Id128< Tag >::Id128().

◆ fromUuid()

template<typename Tag >
template<typename OtherTag >
static constexpr Id128 eve::detail::Id128< Tag >::fromUuid ( const Id128< OtherTag > &  value)
inlinestaticconstexprnoexcept

Re-tags an existing UUID at an explicit domain boundary.

模板参数
OtherTagThe source UUID domain.
参数
valueThe source UUID; its bytes are copied without reinterpretation.
返回
A UUID with the target domain tag.
备注
This is intentionally explicit. Callers must document why a UUID changes semantic domain; ordinary assignment cannot mix identities such as an asset and a scene object.

From uuid.

Constructs a Id128.

在文件 Identity.h 第 136 行定义.

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

被这些函数引用 eve::game_event::GameEventLog::append(), eve::effects::EffectContainer::apply(), eve::card::CardEffectExecutor::applyImmediate(), eve::effects::EffectDefinitionRuntime::applyTo(), eve::transaction::Ledger::create(), eve::procgen::ArtifactPublisher::publish(), eve::card::CardEffectExecutor::settle() , 以及 eve::transaction::Plan::stage().

◆ hash()

template<typename Tag >
constexpr std::uint64_t eve::detail::Id128< Tag >::hash ( ) const
inlineconstexprnoexcept

Returns a stable non-cryptographic hash for hash tables.

返回
A deterministic 64-bit hash of all 16 bytes.
备注
This is not a content digest and must not be used as a security primitive or as a replacement for ContentId.

在文件 Identity.h 第 210 行定义.

◆ isNil()

◆ nil()

template<typename Tag >
static constexpr Id128 eve::detail::Id128< Tag >::nil ( )
inlinestaticconstexprnoexcept

◆ parse()

template<typename Tag >
static std::optional< Id128 > eve::detail::Id128< Tag >::parse ( std::string_view  text)
inlinestaticnoexcept

Parses canonical UUID text.

参数
textA 36-character UUID with 8-4-4-4-12 hexadecimal groups.
返回
The parsed value, or empty when the text is malformed.
备注
Parsing accepts upper- and lower-case hexadecimal digits but does not accept braces or non-canonical separators.

在文件 Identity.h 第 151 行定义.

引用了 eve::detail::Id128< Tag >::bytes(), eve::detail::Id128< Tag >::Id128(), eve::detail::parseUuidText() , 以及 text.

被这些函数引用 eve::effects::EffectContainer::applyCanonical(), eve::card::CardEffectExecutor::applyImmediate(), eve::pixelworld_streaming::decodeChunkBatchArchive(), eve::AssetRef::fromUri(), eve::asset_scene::EvpackSceneTemplateLoader::load(), eve::ObjectRef::parse(), eve::asset::parseEvaManifest(), eve::rts::script_internal::parseScriptSubject(), eve::parseSnapshotEnvelopeValue(), eve::dialogue::DialogueFlow::publishGameplay(), eve::inventory::Inventory::publishGameplay(), eve::card::Card::publishGameplay(), eve::economy::Economy::publishGameplay(), eve::sensing::SensingWorldCandidateProvider::query(), eve::game_event::GameEventLog::restore(), eve::transaction::Ledger::restore(), eve::definition::restoreRuntimeInstance(), eve::graphics::GraphicsArtifactProvider::restoreState(), eve::map::MapArtifactProvider::restoreState(), eve::physics::PhysicsArtifactProvider::restoreState(), eve::scene::SceneArtifactProvider::restoreState(), eve::card::CardEffectExecutor::settle(), eve::rpg::BattleControl::submitGameplay(), eve::card::Card::unpublishGameplay(), eve::dialogue::DialogueFlow::unpublishGameplay(), eve::economy::Economy::unpublishGameplay(), eve::inventory::Inventory::unpublishGameplay() , 以及 eve::settlement::verifySettlementReplayRecord().

友元及相关函数文档

◆ operator<=>

template<typename Tag >
constexpr auto operator<=> ( const Id128< Tag > &  lhs,
const Id128< Tag > &  rhs 
)
friend

Orders UUID bytes in network order for ordered containers.

在文件 Identity.h 第 223 行定义.

◆ operator==

template<typename Tag >
constexpr bool operator== ( const Id128< Tag > &  ,
const Id128< Tag > &   
)
friend

Operator ==.


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