Owning command log and periodic checkpoint projection for PixelWorld. 更多...
#include <PixelWorldReplay.h>
Public 成员函数 | |
| eve::Result< void > | append (PixelReplayEntry entry) |
| Append the next sequenced command; Tick order must be nondecreasing. | |
| eve::Result< void > | captureCheckpoint (const eve::pixelworld::PixelWorld &world) |
| Capture a checkpoint from the synchronously borrowed world. | |
| eve::Result< PixelReplayReceipt > | replay (eve::pixelworld::PixelWorld &target, eve::SimulationTick throughTick) const |
Replay into an empty target through throughTick and verify checkpoints. | |
| eve::Result< eve::SnapshotEnvelope > | snapshot (eve::PersistentId instanceId, const eve::SnapshotHashProvider &hashProvider) const |
| Seal this log in the shared versioned SnapshotEnvelope. | |
| eve::Result< void > | restoreSnapshot (const eve::SnapshotEnvelope &snapshot, const eve::SnapshotHashProvider &hashProvider) |
| Verify, migrate and transactionally replace this log from an envelope. | |
| std::span< const PixelReplayEntry > | entries () const noexcept |
| Immutable owning-log views, valid until this log is mutated or destroyed. | |
| std::span< const PixelReplayCheckpoint > | checkpoints () const noexcept |
详细描述
Owning command log and periodic checkpoint projection for PixelWorld.
The log is not another mutable world authority. It owns immutable replay inputs and digests only. APIs are simulation-thread affine, invoke no callbacks, and use bit-exact integer hashes over canonical PixelWorld bytes.
在文件 PixelWorldReplay.h 第 67 行定义.
成员函数说明
◆ append()
| eve::Result< void > eve::pixelworld_replay::PixelReplayLog::append | ( | PixelReplayEntry | entry | ) |
Append the next sequenced command; Tick order must be nondecreasing.
在文件 PixelWorldReplay.cpp 第 210 行定义.
引用了 eve::pixelworld_replay::PixelReplayEntry::command, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::InvalidArgument, eve::PreconditionViolation, eve::pixelworld::PixelEditCommand::sequence, eve::Result< T >::success(), eve::pixelworld_replay::PixelReplayEntry::tick , 以及 eve::detail::StrongUint64< Tag >::value().
被这些函数引用 restoreSnapshot().
◆ captureCheckpoint()
| eve::Result< void > eve::pixelworld_replay::PixelReplayLog::captureCheckpoint | ( | const eve::pixelworld::PixelWorld & | world | ) |
Capture a checkpoint from the synchronously borrowed world.
- 备注
- The world is not retained or mutated. Checkpoint Tick must increase.
在文件 PixelWorldReplay.cpp 第 228 行定义.
引用了 eve::Diagnostic::error(), eve::Result< T >::failure(), eve::PreconditionViolation, eve::Result< T >::success(), value , 以及 world.
◆ checkpoints()
|
inlinenoexcept |
在文件 PixelWorldReplay.h 第 109 行定义.
◆ entries()
|
inlinenoexcept |
Immutable owning-log views, valid until this log is mutated or destroyed.
在文件 PixelWorldReplay.h 第 108 行定义.
◆ replay()
| eve::Result< PixelReplayReceipt > eve::pixelworld_replay::PixelReplayLog::replay | ( | eve::pixelworld::PixelWorld & | target, |
| eve::SimulationTick | throughTick | ||
| ) | const |
Replay into an empty target through throughTick and verify checkpoints.
- 返回
- A matched receipt or the first Tick/Chunk divergence. Malformed log or non-empty target is a structured failure and leaves admission state unchanged.
- 备注
- The target is mutated after validation succeeds; operational failure during replay may leave it at the last fully committed Tick.
在文件 PixelWorldReplay.cpp 第 239 行定义.
引用了 eve::pixelworld_replay::PixelReplayReceipt::commandsApplied, eve::Diagnostic::error(), eve::Result< T >::failure(), eve::pixelworld_replay::PixelReplayReceipt::firstDivergence, eve::InvalidArgument, eve::pixelworld_replay::PixelReplayReceipt::match, eve::PreconditionViolation, eve::pixelworld_replay::PixelReplayReceipt::reachedTick, eve::Result< T >::success(), target, tick , 以及 eve::detail::StrongUint64< Tag >::value().
◆ restoreSnapshot()
| eve::Result< void > eve::pixelworld_replay::PixelReplayLog::restoreSnapshot | ( | const eve::SnapshotEnvelope & | snapshot, |
| const eve::SnapshotHashProvider & | hashProvider | ||
| ) |
Verify, migrate and transactionally replace this log from an envelope.
- 参数
-
snapshot Externally owned envelope borrowed only for this call. hashProvider Digest provider used to verify the envelope before parsing.
- 备注
- Versions 1 and 2 are accepted. Version 1 checkpoints migrate without per-Chunk diagnostics. Any failure leaves entries and checkpoints unchanged.
在文件 PixelWorldReplay.cpp 第 292 行定义.
引用了 append(), eve::pixelworld_replay::PixelReplayCheckpoint::chunks, eve::Conflict, digest, eve::Diagnostic::error(), eve::Result< T >::failure(), index, eve::InvalidArgument, object, eve::ParseError, path, eve::SnapshotEnvelope::payload, eve::SnapshotEnvelope::revision, revision, eve::pixelworld_replay::PixelReplayCheckpoint::revision, root, eve::SnapshotEnvelope::schema, eve::SnapshotEnvelope::schemaVersion, eve::Result< T >::success(), eve::SnapshotEnvelope::tick, eve::pixelworld_replay::PixelReplayCheckpoint::tick, tick, eve::SnapshotEnvelope::type, eve::UnknownVersion, eve::detail::StrongUint64< Tag >::value(), eve::verifySnapshotEnvelope(), eve::pixelworld_replay::PixelReplayCheckpoint::worldDigest, x , 以及 y.
◆ snapshot()
| eve::Result< eve::SnapshotEnvelope > eve::pixelworld_replay::PixelReplayLog::snapshot | ( | eve::PersistentId | instanceId, |
| const eve::SnapshotHashProvider & | hashProvider | ||
| ) | const |
Seal this log in the shared versioned SnapshotEnvelope.
- 参数
-
instanceId Stable identity of the owning replay/session. hashProvider Injected content digest provider; no weak default is selected.
- 返回
- Schema
pixelworld:replay-logversion 2 with canonical owning payload.
在文件 PixelWorldReplay.cpp 第 281 行定义.
该类的文档由以下文件生成:
- src/modules/pixelworld/replay/PixelWorldReplay.h
- src/modules/pixelworld/replay/PixelWorldReplay.cpp