载入中...
搜索中...
未找到
eve::asset::EvpackRegistry类 参考

Thread-safe owner of current runtime package generations. 更多...

#include <EvpackRegistry.h>

Public 类型

using Callback = std::function< Result< void >(const EvpackRegistryEvent &)>
 

Public 成员函数

Result< EvpackRegistrySubscription > subscribe (Callback callback)
 Subscribe to committed lifecycle changes.
 
Result< void > unsubscribe (EvpackRegistrySubscription subscription)
 Cancel a live subscription; an unknown token returns NotFound.
 
Result< EvpackMountReceipt > commit (PreparedEvpackMount candidate)
 Atomically publish an admitted package and invalidate its previous generation.
 
Result< std::shared_ptr< const Evpack > > resolve (const EvpackHandle &handle) const
 Resolve a current package handle to shared immutable ownership.
 
Result< EvpackAssetHandle > resolveAsset (const AssetRef &asset, std::string_view expectedType, const EvpackCapabilities &capabilities) const
 Resolve one stable AssetRef across uniquely owning mounted packages.
 
Result< RuntimeAssetPayload > readAsset (const EvpackAssetHandle &handle, std::uint64_t maximumDecodedBytes) const
 Decode an asset through its generation-qualified provider handle.
 
Result< EvpackChunkHandle > resolveChunk (const EvpackHandle &handle, const PersistentId &assetId, std::string_view type, EvpackChunkKind kind, std::uint32_t chunkId, std::uint32_t variantIndex) const
 Resolve an exact asset/type/kind/variant tuple to a generation-scoped chunk handle.
 
Result< std::vector< std::uint8_t > > copyChunkBytes (const EvpackChunkHandle &handle) const
 Copy verified chunk bytes so the result remains valid across hot replacement.
 
Result< EvpackUnmountReceipt > unmount (const EvpackHandle &handle)
 Unmount exactly the referenced current generation and dispatch a lock-free event.
 

详细描述

Thread-safe owner of current runtime package generations.

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

成员类型定义说明

◆ Callback

using eve::asset::EvpackRegistry::Callback = std::function<Result<void>(const EvpackRegistryEvent&)>

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

成员函数说明

◆ commit()

Result< EvpackMountReceipt > eve::asset::EvpackRegistry::commit ( PreparedEvpackMount  candidate)

Atomically publish an admitted package and invalidate its previous generation.

参数
candidateOwning candidate consumed only by this call.
返回
Mount receipt identifying the new generation. @thread Safe from any thread. @reentrancy Does not invoke callbacks while holding the registry lock.

在文件 EvpackRegistry.cpp 第 74 行定义.

引用了 callback, eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), handle, eve::InvalidArgument, eve::InvariantViolation, eve::asset::Mounted, eve::NotFound, packageId, eve::asset::Replaced , 以及 eve::Result< T >::success().

◆ copyChunkBytes()

Result< std::vector< std::uint8_t > > eve::asset::EvpackRegistry::copyChunkBytes ( const EvpackChunkHandle &  handle) const

Copy verified chunk bytes so the result remains valid across hot replacement.

在文件 EvpackRegistry.cpp 第 223 行定义.

引用了 eve::Diagnostic::error(), handle, eve::InvalidArgument , 以及 resolve().

◆ readAsset()

Result< RuntimeAssetPayload > eve::asset::EvpackRegistry::readAsset ( const EvpackAssetHandle &  handle,
std::uint64_t  maximumDecodedBytes 
) const

Decode an asset through its generation-qualified provider handle.

返回
Owning payload, StaleHandle after replacement, or NotFound after unload. @thread Safe from any thread.

在文件 EvpackRegistry.cpp 第 196 行定义.

引用了 eve::Result< T >::failure(), handle, eve::asset::EvpackResourceReader::read() , 以及 resolve().

◆ resolve()

Result< std::shared_ptr< const Evpack > > eve::asset::EvpackRegistry::resolve ( const EvpackHandle &  handle) const

Resolve a current package handle to shared immutable ownership.

在文件 EvpackRegistry.cpp 第 143 行定义.

引用了 eve::Diagnostic::error(), found, handle, eve::NotFound , 以及 eve::StaleHandle.

被这些函数引用 copyChunkBytes(), readAsset() , 以及 resolveChunk().

◆ resolveAsset()

Result< EvpackAssetHandle > eve::asset::EvpackRegistry::resolveAsset ( const AssetRef &  asset,
std::string_view  expectedType,
const EvpackCapabilities &  capabilities 
) const

Resolve one stable AssetRef across uniquely owning mounted packages.

返回
A generation-qualified handle after exact type and capability selection. @thread Safe from any thread; the returned handle becomes stale after provider replacement.

在文件 EvpackRegistry.cpp 第 157 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::NotFound, packageId, eve::asset::selectEvpackVariant(), eve::Result< T >::success(), eve::asset::EvpackChunk::type, eve::TypeMismatch , 以及 eve::Unsupported.

◆ resolveChunk()

Result< EvpackChunkHandle > eve::asset::EvpackRegistry::resolveChunk ( const EvpackHandle &  handle,
const PersistentId &  assetId,
std::string_view  type,
EvpackChunkKind  kind,
std::uint32_t  chunkId,
std::uint32_t  variantIndex 
) const

Resolve an exact asset/type/kind/variant tuple to a generation-scoped chunk handle.

返回
Exact chunk handle, NotFound, or StaleHandle.

在文件 EvpackRegistry.cpp 第 205 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::detail::Id128< Tag >::format(), handle, index, kind, eve::NotFound, resolve(), size, eve::Result< T >::success() , 以及 type.

◆ subscribe()

Result< EvpackRegistrySubscription > eve::asset::EvpackRegistry::subscribe ( Callback  callback)

Subscribe to committed lifecycle changes.

备注
Callbacks run synchronously on the committing thread, outside the registry lock. A callback may cancel itself. Callback failures are returned in the operation receipt.

在文件 EvpackRegistry.cpp 第 49 行定义.

引用了 callback, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::InvariantViolation , 以及 eve::Result< T >::success().

◆ unmount()

Result< EvpackUnmountReceipt > eve::asset::EvpackRegistry::unmount ( const EvpackHandle &  handle)

Unmount exactly the referenced current generation and dispatch a lock-free event.

在文件 EvpackRegistry.cpp 第 233 行定义.

引用了 callback, eve::Diagnostic::error(), eve::Result< T >::failure(), found, handle, eve::NotFound, eve::StaleHandle, eve::Result< T >::success() , 以及 eve::asset::Unmounted.

◆ unsubscribe()

Result< void > eve::asset::EvpackRegistry::unsubscribe ( EvpackRegistrySubscription  subscription)

Cancel a live subscription; an unknown token returns NotFound.

在文件 EvpackRegistry.cpp 第 63 行定义.

引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::NotFound, eve::Result< T >::success() , 以及 eve::asset::EvpackRegistrySubscription::value.


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