载入中...
搜索中...
未找到
EvpackRegistry.cpp
浏览该文件的文档.
52 DiagnosticCode::InvalidArgument, "registry callback is empty", {}, {}, "asset.evpack.registry"));
56 Diagnostic::error(DiagnosticCode::InvariantViolation, "registry subscription identity is exhausted", {}, {},
65 return Result<void>::failure(Diagnostic::error(DiagnosticCode::InvalidArgument, "registry subscription identity is invalid", {}, {},
69 return Result<void>::failure(Diagnostic::error(DiagnosticCode::NotFound, "registry subscription is not active", {}, {},
143Result<std::shared_ptr<const Evpack>> EvpackRegistry::resolve(const EvpackHandle& handle) const {
148 Diagnostic::error(DiagnosticCode::NotFound, "runtime package is not mounted", handle.packageId.format(), {},
152 Diagnostic::error(DiagnosticCode::StaleHandle, "runtime package handle is stale", handle.packageId.format(),
162 DiagnosticCode::InvalidArgument, "expected runtime asset type is empty", {}, {}, "asset.evpack.registry"));
215 if (chunk.assetId == assetId && chunk.type == type && chunk.kind == kind && chunk.chunkId == chunkId &&
220 DiagnosticCode::NotFound, "runtime chunk is not present", assetId.format(), {}, "asset.evpack.registry"));
223Result<std::vector<std::uint8_t>> EvpackRegistry::copyChunkBytes(const EvpackChunkHandle& handle) const {
229 DiagnosticCode::InvalidArgument, "chunk index is outside the TOC", {}, {}, "asset.evpack.registry"));
243 DiagnosticCode::StaleHandle, "runtime package handle is stale", {}, {}, "asset.evpack.registry"));
Prepare/commit runtime package publication with stale-generation detection.
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Result< RuntimeAssetPayload > readAsset(const EvpackAssetHandle &handle, std::uint64_t maximumDecodedBytes) const
Decode an asset through its generation-qualified provider handle.
Definition EvpackRegistry.cpp:196
Result< std::vector< std::uint8_t > > copyChunkBytes(const EvpackChunkHandle &handle) const
Copy verified chunk bytes so the result remains valid across hot replacement.
Definition EvpackRegistry.cpp:223
Result< std::shared_ptr< const Evpack > > resolve(const EvpackHandle &handle) const
Resolve a current package handle to shared immutable ownership.
Definition EvpackRegistry.cpp:143
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.
Definition EvpackRegistry.cpp:205
Result< void > unsubscribe(EvpackRegistrySubscription subscription)
Cancel a live subscription; an unknown token returns NotFound.
Definition EvpackRegistry.cpp:63
Result< EvpackRegistrySubscription > subscribe(Callback callback)
Subscribe to committed lifecycle changes.
Definition EvpackRegistry.cpp:49
Result< EvpackAssetHandle > resolveAsset(const AssetRef &asset, std::string_view expectedType, const EvpackCapabilities &capabilities) const
Resolve one stable AssetRef across uniquely owning mounted packages.
Definition EvpackRegistry.cpp:157
std::function< Result< void >(const EvpackRegistryEvent &)> Callback
Definition EvpackRegistry.h:114
Result< EvpackUnmountReceipt > unmount(const EvpackHandle &handle)
Unmount exactly the referenced current generation and dispatch a lock-free event.
Definition EvpackRegistry.cpp:233
Result< EvpackMountReceipt > commit(PreparedEvpackMount candidate)
Atomically publish an admitted package and invalidate its previous generation.
Definition EvpackRegistry.cpp:74
Immutable reader retaining an admitted pack by shared ownership.
Definition EvpackResourceReader.h:29
Result< RuntimeAssetPayload > read(const AssetRef &asset, std::string_view expectedType, const EvpackCapabilities &capabilities, std::uint64_t maximumDecodedBytes) const
Resolve, type-check, variant-select and decode a canonical runtime asset.
Definition EvpackResourceReader.cpp:10
Owning admitted mount candidate that has not changed observable registry state.
Definition EvpackRegistry.h:77
std::string format() const
Formats the ID in lower-case canonical UUID text.
Definition Identity.h:173
Definition AssetCooker.cpp:17
Result< Evpack > parseEvpack(std::span< const std::uint8_t > bytes, const EvpackLimits &limits, const EvpackTrust &trust)
Parse, bound-check and hash-verify a complete untrusted .evpack.
Definition Evpack.cpp:542
Result< EvpackVariantSelection > selectEvpackVariant(const Evpack &pack, const EvpackCapabilities &capabilities)
Select the first explicitly ordered variant satisfied by device capabilities.
Definition Evpack.cpp:585
Result< PreparedEvpackMount > prepareEvpackMount(std::span< const std::uint8_t > bytes, const EvpackLimits &limits, const EvpackTrust &trust)
Fully parse and verify package bytes without publishing them.
Definition EvpackRegistry.cpp:40
@ InvalidArgument
@ TypeMismatch
A stable reference resolved to a different canonical domain type.
@ NotFound
@ CallbackFailure
@ Unsupported
@ InvariantViolation
@ StaleHandle
@ Conflict
Generation-scoped stable-reference resolution across mounted packages.
Definition EvpackRegistry.h:36
Actual runtime device capabilities used for variant selection.
Definition Evpack.h:92
Generation-scoped handle to one verified chunk in a mounted package.
Definition EvpackRegistry.h:30
Generation-scoped handle to one mounted runtime package.
Definition EvpackRegistry.h:20
Resource limits checked before package allocations and hash work.
Definition Evpack.h:126
Immutable lifecycle event delivered to registry subscribers.
Definition EvpackRegistry.h:54
Opaque identity used to cancel a registry subscription.
Definition EvpackRegistry.h:60