Scene-sink decorator projecting exact-build procedural prefab bindings into owned ECS renderers. @ownership Scene remains the author of batch metadata; cached snapshots are renderer projections guarded by its revision. @lifetime Graphics, underlying Scene sink, ECS table and admitted prefab factories outlive this object and release. @thread Graphics/Scene/ECS owner thread, outside iteration; synchronous, non-reentrant, no locks. 更多...
#include <ProcgenPrefabSceneSink.h>
类 | |
| struct | Impl |
Public 成员函数 | |
| ProcgenPrefabSceneSink (graphics::Graphics &graphics, IProcgenSceneSink &scene) | |
| Bind borrowed rendering and Scene owners; does not install a global capability or publish anything. | |
| ~ProcgenPrefabSceneSink () override | |
| Attempt checked release before teardown and report failures; explicit release permits retry. | |
| ProcgenPrefabSceneSink (const ProcgenPrefabSceneSink &)=delete | |
| ProcgenPrefabSceneSink & | operator= (const ProcgenPrefabSceneSink &)=delete |
| Result< void > | admit (std::shared_ptr< EvpackStaticPrefab > prefab) |
| Admit and pin one immutable asset/build version; historical versions remain available for undo/restore. | |
| Result< void > | collectRetired () |
| Release retired, already hidden renderers without changing committed batches. | |
| Result< void > | release () |
| Remove all owned batches through Scene coordination, collect resources and close the decorator. | |
| std::size_t | rendererCount (const std::string &batchId) const noexcept |
| Number of active renderer parts in a batch; metadata-only anchors contribute zero. | |
| std::size_t | pendingRetirements () const noexcept |
| Number of retired batch resource sets awaiting collectRetired, bounded to 64. | |
| bool | applyBatch (const std::string &, const std::vector< ProcgenInstanceDesc > &) override |
| Compatibility projection assigning absent PointIds by stable instance id before canonical replacement. @cost Same full-batch staging as replaceBatch, amortized per explicit publication. | |
| Result< uint64_t > | replaceBatch (const std::string &, uint64_t, const std::vector< ProcgenInstanceDesc > &) override |
| Atomically replace a batch with a complete stable-identity snapshot at an explicit revision. | |
| Result< uint64_t > | replaceBatches (const std::vector< ProcgenBatchSnapshot > &) override |
| Atomically replace several batches from complete snapshots. | |
| Result< uint64_t > | replaceBatchesCoordinated (const std::vector< ProcgenBatchSnapshot > &, const std::function< Result< void >()> &) override |
| Replace complete batches while committing one prepared external resource owner. | |
| bool | removeBatch (const std::string &) override |
| Compatibility wrapper over checked coordinated removal. @cost Same Scene staging and renderer retirement as removeBatches, once per explicit removal. | |
| Result< uint64_t > | removeBatches (const std::vector< std::string > &) override |
| Atomically remove several published batches. | |
| Result< uint64_t > | removeBatchesCoordinated (const std::vector< std::string > &, const std::function< Result< void >()> &) override |
| Remove several batches while coordinating one external authoritative commit. | |
| Result< uint64_t > | applyDelta (const std::string &, const ProcgenInstanceDelta &) override |
| Apply one prevalidated identity delta atomically to an existing batch. | |
| uint64_t | batchRevision (const std::string &) const override |
| Current committed revision of a batch, or zero when it is absent. | |
| int | instanceCount (const std::string &) const override |
| Number of currently published instances in a batch. | |
| int | lastCreatedCount (const std::string &) const override |
| Instances newly created by the batch's latest successful apply. | |
| int | lastReusedCount (const std::string &) const override |
| Stable-id instances reused by the batch's latest successful apply. | |
| int | lastRemovedCount (const std::string &) const override |
| Instances removed by the batch's latest successful apply or removal. | |
Public 成员函数 继承自 eve::IProcgenSceneSink | |
| virtual | ~IProcgenSceneSink ()=default |
| I procgen scene sink. | |
额外继承的成员函数 | |
静态 Public 属性 继承自 eve::IProcgenSceneSink | |
| static constexpr const char * | capabilityName = "IProcgenSceneSink" |
详细描述
Scene-sink decorator projecting exact-build procedural prefab bindings into owned ECS renderers. @ownership Scene remains the author of batch metadata; cached snapshots are renderer projections guarded by its revision. @lifetime Graphics, underlying Scene sink, ECS table and admitted prefab factories outlive this object and release. @thread Graphics/Scene/ECS owner thread, outside iteration; synchronous, non-reentrant, no locks.
- 备注
- Composition owns capability registration/unregistration and makes this the sole batch writer while installed. Unbound asset labels remain metadata anchors. No implicit IO, prefab lookup by label, Scene links or simulation System. Admitted mesh/image leases must belong to the bound Graphics device/context; cross-context variant admission is unsupported. Capacity bounds: 4096 admitted asset/build versions, 64 active/retired transaction batches, and 65536 peak instances/renderer parts across active, retired and prepared snapshots. Collect retired resources between large publications. Each delta collection is bounded to 65536 entries before staging.
在文件 ProcgenPrefabSceneSink.h 第 24 行定义.
构造及析构函数说明
◆ ProcgenPrefabSceneSink() [1/2]
| eve::asset_graphics::ProcgenPrefabSceneSink::ProcgenPrefabSceneSink | ( | graphics::Graphics & | graphics, |
| IProcgenSceneSink & | scene | ||
| ) |
Bind borrowed rendering and Scene owners; does not install a global capability or publish anything.
在文件 ProcgenPrefabSceneSink.cpp 第 172 行定义.
◆ ~ProcgenPrefabSceneSink()
|
override |
Attempt checked release before teardown and report failures; explicit release permits retry.
在文件 ProcgenPrefabSceneSink.cpp 第 174 行定义.
◆ ProcgenPrefabSceneSink() [2/2]
|
delete |
成员函数说明
◆ admit()
| Result< void > eve::asset_graphics::ProcgenPrefabSceneSink::admit | ( | std::shared_ptr< EvpackStaticPrefab > | prefab | ) |
Admit and pin one immutable asset/build version; historical versions remain available for undo/restore.
- 返回
- Success or null/released/duplicate-version/budget failure, without replacing existing versions. @cost Logarithmic insertion plus a fixed pin allocation, at most 4096 versions after explicit loading; no IO/upload.
在文件 ProcgenPrefabSceneSink.cpp 第 178 行定义.
引用了 eve::Conflict, eve::Diagnostic::error(), eve::Result< T >::failure(), key, eve::asset_graphics::EvpackStaticPrefab::pinResources(), eve::PreconditionViolation, prefab , 以及 eve::Result< T >::success().
◆ applyBatch()
|
overridevirtual |
Compatibility projection assigning absent PointIds by stable instance id before canonical replacement. @cost Same full-batch staging as replaceBatch, amortized per explicit publication.
在文件 ProcgenPrefabSceneSink.cpp 第 218 行定义.
引用了 batchRevision(), found, previous, replaceBatch(), result, target, used , 以及 value.
◆ applyDelta()
|
overridevirtual |
Apply one prevalidated identity delta atomically to an existing batch.
- 返回
- The committed target revision, or a structured stale/validation/provider failure. @thread Called synchronously on the scene-owning thread; implementations must not retain references. @reentrant Not reentrant for the same batch. @cost Identity staging plus full affected-batch renderer preparation, amortized per explicit delta.
- 备注
- Scene identities persist; this adapter currently recreates affected ECS renderer entities.
在文件 ProcgenPrefabSceneSink.cpp 第 243 行定义.
引用了 eve::ProcgenInstanceDelta::added, eve::buildProcgenInstanceDeltaSnapshot(), count, eve::Diagnostic::error(), eve::Result< T >::failure(), found, eve::NotFound, eve::PreconditionViolation, eve::ProcgenInstanceDelta::removed, eve::ProcgenInstanceDelta::removedPointIds, replaceBatch(), revision, target, eve::ProcgenInstanceDelta::targetOrder, eve::ProcgenInstanceDelta::targetPointOrder, eve::ProcgenInstanceDelta::targetRevision , 以及 eve::ProcgenInstanceDelta::updated.
◆ batchRevision()
|
overridevirtual |
Current committed revision of a batch, or zero when it is absent.
在文件 ProcgenPrefabSceneSink.cpp 第 328 行定义.
被这些函数引用 applyBatch().
◆ collectRetired()
| Result< void > eve::asset_graphics::ProcgenPrefabSceneSink::collectRetired | ( | ) |
Release retired, already hidden renderers without changing committed batches.
- 返回
- Success or cleanup failure retaining resources for retry. @cost Linear in retired renderer parts, amortized after explicit publication; no Scene callbacks.
在文件 ProcgenPrefabSceneSink.cpp 第 292 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), node, eve::PreconditionViolation, result , 以及 eve::Result< T >::success().
被这些函数引用 release().
◆ instanceCount()
|
overridevirtual |
Number of currently published instances in a batch.
在文件 ProcgenPrefabSceneSink.cpp 第 329 行定义.
◆ lastCreatedCount()
|
overridevirtual |
Instances newly created by the batch's latest successful apply.
在文件 ProcgenPrefabSceneSink.cpp 第 330 行定义.
◆ lastRemovedCount()
|
overridevirtual |
Instances removed by the batch's latest successful apply or removal.
在文件 ProcgenPrefabSceneSink.cpp 第 332 行定义.
◆ lastReusedCount()
|
overridevirtual |
Stable-id instances reused by the batch's latest successful apply.
在文件 ProcgenPrefabSceneSink.cpp 第 331 行定义.
◆ operator=()
|
delete |
◆ pendingRetirements()
|
noexcept |
Number of retired batch resource sets awaiting collectRetired, bounded to 64.
在文件 ProcgenPrefabSceneSink.cpp 第 327 行定义.
◆ release()
| Result< void > eve::asset_graphics::ProcgenPrefabSceneSink::release | ( | ) |
Remove all owned batches through Scene coordination, collect resources and close the decorator.
- 返回
- Success or checked publication/cleanup failure; retry before owner teardown. @cost Linear in owned and retired parts plus Scene staging, once per owner teardown; no IO.
在文件 ProcgenPrefabSceneSink.cpp 第 304 行定义.
引用了 collectRetired(), eve::Diagnostic::error(), eve::Result< T >::failure(), ids, eve::PreconditionViolation, removeBatches(), removed , 以及 eve::Result< T >::success().
被这些函数引用 ~ProcgenPrefabSceneSink().
◆ removeBatch()
|
overridevirtual |
Compatibility wrapper over checked coordinated removal. @cost Same Scene staging and renderer retirement as removeBatches, once per explicit removal.
在文件 ProcgenPrefabSceneSink.cpp 第 288 行定义.
引用了 eve::Result< T >::ok(), removeBatches() , 以及 result.
◆ removeBatches()
|
overridevirtual |
Atomically remove several published batches.
- 参数
-
batchIds Non-empty unique identities of existing batches.
- 返回
- Number of removed batches, or a structured failure with no batch changed. @thread Called synchronously on the scene-owning thread; implementations must not retain references. @reentrant Not reentrant. Callbacks run only after every batch is no longer visible or queryable. @cost Linear in affected renderer parts plus Scene cache staging per explicit removal; cleanup is deferred.
在文件 ProcgenPrefabSceneSink.cpp 第 285 行定义.
引用了 ids, removeBatchesCoordinated() , 以及 eve::Result< T >::success().
被这些函数引用 release() , 以及 removeBatch().
◆ removeBatchesCoordinated()
|
overridevirtual |
Remove several batches while coordinating one external authoritative commit.
- 参数
-
batchIds Non-empty unique identities of existing batches. commitPreparedOwner Called after Scene preparation and before Scene state becomes visible.
- 返回
- Number of removed batches, or a structured failure with neither owner changed. Post-commit notification exceptions return Applied with warning diagnostics; they do not undo publication. @thread Called synchronously on the scene-owning thread; references are not retained. @reentrant The commit callback must not reenter Scene and must leave its owner unchanged on failure. @cost Scene cache staging and affected renderer retirement per explicit removal; the owner is pre-prepared.
在文件 ProcgenPrefabSceneSink.cpp 第 262 行定义.
引用了 busy, committed, eve::Diagnostic::error(), eve::Result< T >::failure(), ids, owner, eve::PreconditionViolation, revision, eve::Result< T >::success() , 以及 eve::asset_graphics::ProcgenPrefabSceneSink::Impl::visibility().
被这些函数引用 removeBatches().
◆ rendererCount()
|
noexcept |
Number of active renderer parts in a batch; metadata-only anchors contribute zero.
在文件 ProcgenPrefabSceneSink.cpp 第 323 行定义.
引用了 found.
◆ replaceBatch()
|
overridevirtual |
Atomically replace a batch with a complete stable-identity snapshot at an explicit revision.
- 参数
-
batchId Non-empty batch identity. targetRevision Non-zero revision newer than the currently committed batch revision. instances Complete ordered target snapshot; every instance must have a unique non-zero source PointId.
- 返回
- The committed target revision, or a structured stale/validation/provider failure. @thread Called synchronously on the scene-owning thread; implementations must not retain references. @reentrant Not reentrant for the same batch. @cost Linear in prepared renderer parts plus Scene staging, with allocations once per explicit publication.
在文件 ProcgenPrefabSceneSink.cpp 第 212 行定义.
引用了 id, replaceBatches(), result, revision , 以及 eve::Result< T >::success().
被这些函数引用 applyBatch() , 以及 applyDelta().
◆ replaceBatches()
|
overridevirtual |
Atomically replace several batches from complete snapshots.
- 参数
-
snapshots Non-empty transaction whose batch ids are unique.
- 返回
- Number of committed batches, or a structured failure with no batch changed. @thread Called synchronously on the scene-owning thread; implementations must not retain references. @reentrant Not reentrant. No scene callback may observe a partially committed transaction. @cost Full staging of every affected batch and the Scene cache, amortized per explicit publication.
在文件 ProcgenPrefabSceneSink.cpp 第 209 行定义.
引用了 replaceBatchesCoordinated() , 以及 eve::Result< T >::success().
被这些函数引用 replaceBatch().
◆ replaceBatchesCoordinated()
|
overridevirtual |
Replace complete batches while committing one prepared external resource owner.
- 参数
-
snapshots Non-empty unique batch snapshots with newer non-zero revisions. commitPreparedOwner Synchronous commit after Scene preparation, before any Scene publication or events.
- 返回
- Committed batch count, or failure with prior Scene batches unchanged. Unsupported providers do not call commit. Post-commit notification exceptions return Applied with warning diagnostics, preserving the committed outcome. @thread Scene-owner thread, outside ECS iteration; references are call-scoped, no locks. @reentrant Commit must not access or mutate Scene, invoke scripts, or reenter the sink; failure leaves its owner unchanged. @cost Linear in target instances and the committed Scene cache; staging allocations amortized per explicit publication. @cost Full renderer/Scene staging per explicit publication; the external owner must already be prepared.
在文件 ProcgenPrefabSceneSink.cpp 第 191 行定义.
引用了 busy, committed, eve::Diagnostic::error(), eve::Result< T >::failure(), owner, eve::PreconditionViolation, eve::Result< T >::success() , 以及 valid.
被这些函数引用 replaceBatches().
该类的文档由以下文件生成:
- src/modules/asset/graphics/ProcgenPrefabSceneSink.h
- src/modules/asset/graphics/ProcgenPrefabSceneSink.cpp
Public 成员函数 继承自