Optional scene consumer for procedural instance batches. 更多...
#include <ProcgenSceneSink.h>
Public 成员函数 | |
| virtual | ~IProcgenSceneSink ()=default |
| I procgen scene sink. | |
| virtual bool | applyBatch (const std::string &batchId, const std::vector< ProcgenInstanceDesc > &instances)=0 |
| Create or reconcile all instances in a named batch. | |
| virtual Result< uint64_t > | replaceBatch (const std::string &batchId, uint64_t targetRevision, const std::vector< ProcgenInstanceDesc > &instances)=0 |
| Atomically replace a batch with a complete stable-identity snapshot at an explicit revision. | |
| virtual Result< uint64_t > | replaceBatches (const std::vector< ProcgenBatchSnapshot > &snapshots)=0 |
| Atomically replace several batches from complete snapshots. | |
| virtual bool | removeBatch (const std::string &batchId)=0 |
| Remove the visible contents of a batch. | |
| virtual Result< uint64_t > | removeBatches (const std::vector< std::string > &batchIds)=0 |
| Atomically remove several published batches. | |
| virtual Result< uint64_t > | removeBatchesCoordinated (const std::vector< std::string > &batchIds, const std::function< Result< void >()> &commitPreparedOwner)=0 |
| Remove several batches while coordinating one external authoritative commit. | |
| virtual Result< uint64_t > | applyDelta (const std::string &batchId, const ProcgenInstanceDelta &delta)=0 |
| Apply one prevalidated identity delta atomically to an existing batch. | |
| virtual uint64_t | batchRevision (const std::string &batchId) const =0 |
| Current committed revision of a batch, or zero when it is absent. | |
| virtual int | instanceCount (const std::string &batchId) const =0 |
| Number of currently published instances in a batch. | |
| virtual int | lastCreatedCount (const std::string &batchId) const =0 |
| Instances newly created by the batch's latest successful apply. | |
| virtual int | lastReusedCount (const std::string &batchId) const =0 |
| Stable-id instances reused by the batch's latest successful apply. | |
| virtual int | lastRemovedCount (const std::string &batchId) const =0 |
| Instances removed by the batch's latest successful apply or removal. | |
| virtual Result< uint64_t > | replaceBatchesCoordinated (const std::vector< ProcgenBatchSnapshot > &snapshots, const std::function< Result< void >()> &commitPreparedOwner) |
| Replace complete batches while committing one prepared external resource owner. | |
静态 Public 属性 | |
| static constexpr const char * | capabilityName = "IProcgenSceneSink" |
详细描述
Optional scene consumer for procedural instance batches.
The interface lives in common so procgen can publish results without an upward dependency on scene. Scene providers must replace a batch atomically and preserve stable instance ids across rebuilds.
在文件 ProcgenSceneSink.h 第 92 行定义.
构造及析构函数说明
◆ ~IProcgenSceneSink()
|
virtualdefault |
I procgen scene sink.
成员函数说明
◆ applyBatch()
|
pure virtual |
Create or reconcile all instances in a named batch.
◆ applyDelta()
|
pure virtual |
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.
◆ batchRevision()
|
pure virtual |
Current committed revision of a batch, or zero when it is absent.
在 eve::asset_graphics::ProcgenPrefabSceneSink 内被实现.
被这些函数引用 eve::asset_graphics::ProcgenPrefabSceneSink::Impl::prepare() , 以及 eve::asset_graphics::ProcgenPrefabSceneSink::Impl::validateRevision().
◆ instanceCount()
|
pure virtual |
Number of currently published instances in a batch.
◆ lastCreatedCount()
|
pure virtual |
Instances newly created by the batch's latest successful apply.
◆ lastRemovedCount()
|
pure virtual |
Instances removed by the batch's latest successful apply or removal.
◆ lastReusedCount()
|
pure virtual |
Stable-id instances reused by the batch's latest successful apply.
◆ removeBatch()
|
pure virtual |
Remove the visible contents of a batch.
◆ removeBatches()
|
pure virtual |
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.
◆ removeBatchesCoordinated()
|
pure virtual |
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.
◆ replaceBatch()
|
pure virtual |
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.
◆ replaceBatches()
|
pure virtual |
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.
◆ replaceBatchesCoordinated()
|
inlinevirtual |
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.
被 eve::asset_graphics::ProcgenPrefabSceneSink 重载.
在文件 ProcgenSceneSink.h 第 172 行定义.
类成员变量说明
◆ capabilityName
|
staticconstexpr |
在文件 ProcgenSceneSink.h 第 94 行定义.
该类的文档由以下文件生成:
- src/engine/common/ProcgenSceneSink.h