Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::timeline::CommandJournal Class Reference

Bounded, replayable in-memory log of contiguous document revisions. More...

#include <journal.hpp>

Public Member Functions

 CommandJournal (JournalLimits limits)
 Creates an empty revision-zero journal with fixed quotas.
runtime::Result< Project, TransactionError > replay (const Project &checkpoint, DocumentRevision checkpoint_revision) const
 Deterministically applies all entries after the supplied checkpoint.
std::span< const JournalEntry > entries () const noexcept
 Returns the retained suffix in revision order.
std::size_t retained_bytes () const noexcept
 Returns the saturated retained-size accounting for entries.
std::size_t command_count () const noexcept
 Returns the total number of command envelopes in retained entries.
DocumentRevision base_revision () const noexcept
 Returns the revision of the checkpoint preceding entries().

Friends

class detail::JournalAccess

Detailed Description

Bounded, replayable in-memory log of contiguous document revisions.

The journal owns its entries and, after its first append, the checkpoint snapshot needed to validate replay. Public inspection views remain valid until the journal is mutated or destroyed. DocumentSession serializes all mutation; a standalone CommandJournal is not internally synchronized.

Constructor & Destructor Documentation

◆ CommandJournal()

pulp::timeline::CommandJournal::CommandJournal ( JournalLimits limits)
inlineexplicit

Creates an empty revision-zero journal with fixed quotas.

Member Function Documentation

◆ base_revision()

DocumentRevision pulp::timeline::CommandJournal::base_revision ( ) const
inlinenoexcept

Returns the revision of the checkpoint preceding entries().

◆ command_count()

std::size_t pulp::timeline::CommandJournal::command_count ( ) const
inlinenoexcept

Returns the total number of command envelopes in retained entries.

◆ entries()

std::span< const JournalEntry > pulp::timeline::CommandJournal::entries ( ) const
inlinenoexcept

Returns the retained suffix in revision order.

◆ replay()

runtime::Result< Project, TransactionError > pulp::timeline::CommandJournal::replay ( const Project & checkpoint,
DocumentRevision checkpoint_revision ) const

Deterministically applies all entries after the supplied checkpoint.

The checkpoint revision and, when retained, snapshot must match the journal base. Replay verifies contiguous revisions, writer-scoped transaction and command monotonicity, model validity, and exact DirtySet reproduction.

◆ retained_bytes()

std::size_t pulp::timeline::CommandJournal::retained_bytes ( ) const
inlinenoexcept

Returns the saturated retained-size accounting for entries.

◆ detail::JournalAccess

friend class detail::JournalAccess
friend

The documentation for this class was generated from the following file:
  • /home/runner/work/pulp/pulp/core/timeline/include/pulp/timeline/journal.hpp