In-memory owner and publisher for generated artifacts. 更多...
#include <GeneratedArtifact.h>
Public 成员函数 | |
| eve::Result< ArtifactId > | publish (GeneratedArtifact artifact) |
| Validate and atomically publish one artifact and all composite parts. | |
| eve::Result< std::vector< ArtifactId > > | publishBatch (std::vector< GeneratedArtifact > artifacts) |
| Validate and atomically publish a dependency-connected batch. | |
| eve::Result< std::unique_ptr< eve::artifact::PreparedPublication > > | stagePublish (GeneratedArtifact artifact) |
| Prepare one store mutation for a larger provider transaction. | |
| eve::Result< eve::Value > | snapshotState () const |
| Export identity, build-key and complete typed dense payload state. | |
| eve::Result< void > | restoreState (const eve::Value &state) |
| Restore complete identity/build-key and typed payload state transactionally. | |
| const GeneratedArtifact * | find (ArtifactId id) const noexcept |
| Look up a published artifact. | |
| const ArtifactPart * | findPart (ArtifactId id) const noexcept |
| Look up a composite child part. | |
| std::optional< ArtifactType > | typeOf (ArtifactId id) const noexcept |
| Return the kind of a live identity or composite part. | |
| std::vector< ArtifactId > | findByBuildKey (const BuildKey &key) const |
| Find all identities with a matching deterministic build key. | |
| eve::Result< void > | remove (ArtifactId id) |
| Remove one artifact; NotFound is returned when absent. | |
| void | clear () noexcept |
| Remove all published artifacts. | |
| std::size_t | size () const noexcept |
| Return the number of published top-level artifacts. | |
| std::size_t | partCount () const noexcept |
| Return the number of indexed composite child products. | |
友元 | |
| class | ArtifactStoreStage |
详细描述
In-memory owner and publisher for generated artifacts.
The store owns records after publish. Pointers returned by find are borrowed and are invalidated by publish, remove or clear. Publishing never replaces an existing identity; build keys are lookup metadata and do not become identities.
在文件 GeneratedArtifact.h 第 227 行定义.
成员函数说明
◆ clear()
|
noexcept |
Remove all published artifacts.
在文件 GeneratedArtifact.cpp 第 1496 行定义.
◆ find()
|
noexcept |
Look up a published artifact.
- 返回
- A nullable borrowed pointer, or
nullptrwhen the identity is absent. @ownership Borrowed from this store;ArtifactStoreowns the artifact and the caller must not delete or transfer the pointer. @nullable Yes, for an unknown or removed identity. @lifetime Valid until the next publish, remove, clear, restore or store destruction; copy the artifact or use its identity for later lookup. @thread Calls and returned observations share the store's owner-thread affinity. @reentrancy Side-effect free; do not mutate the store while using the pointer.
在文件 GeneratedArtifact.cpp 第 1441 行定义.
引用了 found.
被这些函数引用 publishBatch().
◆ findByBuildKey()
| std::vector< ArtifactId > eve::procgen::ArtifactStore::findByBuildKey | ( | const BuildKey & | key | ) | const |
Find all identities with a matching deterministic build key.
在文件 GeneratedArtifact.cpp 第 1473 行定义.
引用了 key.
◆ findPart()
|
noexcept |
Look up a composite child part.
- 返回
- A nullable borrowed pointer, or
nullptrwhen the part is absent. @ownership Borrowed from this store; its owning top-level artifact remains the sole owner and the caller must not delete the pointer. @nullable Yes, for an unknown, removed or non-composite identity. @lifetime Valid until publish, remove, clear, restore or store destruction; use the part identity to resolve it again after a mutation. @thread Calls and returned observations share the store's owner-thread affinity. @reentrancy Side-effect free and does not invoke provider callbacks.
在文件 GeneratedArtifact.cpp 第 1446 行定义.
引用了 children, eve::procgen::Composite, found, eve::procgen::GeneratedArtifact::payload , 以及 eve::procgen::GeneratedArtifact::type.
◆ partCount()
|
noexcept |
Return the number of indexed composite child products.
在文件 GeneratedArtifact.cpp 第 1502 行定义.
被这些函数引用 restoreState().
◆ publish()
| eve::Result< ArtifactId > eve::procgen::ArtifactStore::publish | ( | GeneratedArtifact | artifact | ) |
Validate and atomically publish one artifact and all composite parts.
- 参数
-
artifact Owning artifact to publish.
- 返回
- Its instance identity, or a structured validation/dependency error.
- 备注
- A failed Result leaves both top-level and part registries unchanged.
在文件 GeneratedArtifact.cpp 第 1300 行定义.
引用了 ids, publishBatch(), eve::Result< T >::success() , 以及 eve::Result< T >::takeValue().
◆ publishBatch()
| eve::Result< std::vector< ArtifactId > > eve::procgen::ArtifactStore::publishBatch | ( | std::vector< GeneratedArtifact > | artifacts | ) |
Validate and atomically publish a dependency-connected batch.
- 参数
-
artifacts Owning top-level artifacts; dependencies may reference existing records or any top-level/part record in this batch.
- 返回
- Published top-level identities in input order.
- 备注
- A failed Result leaves the store unchanged.
在文件 GeneratedArtifact.cpp 第 1307 行定义.
引用了 children, eve::procgen::Collider, eve::procgen::Composite, eve::Conflict, error, eve::Diagnostic::error(), eve::Failed, find(), found, ids, eve::InvalidArgument, eve::procgen::MeshData, eve::NotFound, eve::procgen::GeneratedArtifact::payload, eve::PreconditionViolation, type , 以及 eve::procgen::GeneratedArtifact::type.
被这些函数引用 publish().
◆ remove()
| eve::Result< void > eve::procgen::ArtifactStore::remove | ( | ArtifactId | id | ) |
Remove one artifact; NotFound is returned when absent.
在文件 GeneratedArtifact.cpp 第 1483 行定义.
引用了 eve::Applied, eve::procgen::Composite, eve::Diagnostic::error(), eve::Result< T >::failure(), found, eve::NotFound, eve::Status::success() , 以及 eve::Result< T >::success().
◆ restoreState()
| eve::Result< void > eve::procgen::ArtifactStore::restoreState | ( | const eve::Value & | state | ) |
Restore complete identity/build-key and typed payload state transactionally.
- 参数
-
state State previously emitted by snapshotState().
- 返回
- Applied or a structured parse/conflict error.
- 备注
- The candidate graph is parsed and validated before either store index is changed. After success, find() and findPart() return the restored dense records immediately.
在文件 GeneratedArtifact.cpp 第 1526 行定义.
引用了 eve::Applied, eve::procgen::Composite, eve::Conflict, eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), eve::ParseError, partCount(), state, eve::Status::success(), eve::Result< T >::success(), eve::UnknownVersion , 以及 valid.
◆ size()
|
inlinenoexcept |
Return the number of published top-level artifacts.
在文件 GeneratedArtifact.h 第 304 行定义.
◆ snapshotState()
| eve::Result< eve::Value > eve::procgen::ArtifactStore::snapshotState | ( | ) | const |
Export identity, build-key and complete typed dense payload state.
- 返回
- An owning value suitable for a SnapshotEnvelope.
在文件 GeneratedArtifact.cpp 第 1504 行定义.
引用了 eve::Diagnostic::error(), eve::Failed, eve::Result< T >::failure(), ids, state , 以及 eve::Result< T >::success().
◆ stagePublish()
| eve::Result< std::unique_ptr< eve::artifact::PreparedPublication > > eve::procgen::ArtifactStore::stagePublish | ( | GeneratedArtifact | artifact | ) |
Prepare one store mutation for a larger provider transaction.
- 参数
-
artifact Owning CPU artifact to stage.
- 返回
- A hidden store stage; it becomes visible only on commit.
- 备注
- The returned stage shares the store's main-thread affinity.
在文件 GeneratedArtifact.cpp 第 1399 行定义.
引用了 eve::procgen::Composite, eve::Conflict, eve::Diagnostic::error(), eve::Failed , 以及 valid.
◆ typeOf()
|
noexcept |
Return the kind of a live identity or composite part.
在文件 GeneratedArtifact.cpp 第 1457 行定义.
引用了 children, eve::procgen::Composite, found , 以及 value.
友元及相关函数文档
◆ ArtifactStoreStage
|
friend |
在文件 GeneratedArtifact.h 第 309 行定义.
该类的文档由以下文件生成:
- src/modules/procgen/GeneratedArtifact.h
- src/modules/procgen/GeneratedArtifact.cpp