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

Native, crash-consistent Timeline persistence sink. More...

#include <file_journal.hpp>

Public Member Functions

 ~FileJournal () override
 Flushes no additional state and releases the file and lifetime locks.
 FileJournal (const FileJournal &)=delete
FileJournal & operator= (const FileJournal &)=delete
runtime::Result< bool, JournalSinkError > append_batch (const JournalEntry &entry) noexcept override
 Durably appends the entry's resulting canonical snapshot frame.
runtime::Result< bool, JournalSinkError > checkpoint (const Project &snapshot, DocumentRevision durable_revision) noexcept override
 Atomically replaces durable history with snapshot at durable_revision.
runtime::Result< bool, JournalSinkError > validate_restore (const Project &snapshot, DocumentRevision durable_revision) noexcept override
 Compares snapshot and revision with the sink's recovered durable state.

Static Public Member Functions

static runtime::Result< FileJournalOpenResult, FileJournalError > open (const std::filesystem::path &path, Project fallback, SchemaRegistry registry, const FileJournalLimits &limits={})
 Opens, creates, or recovers a journal at path.

Detailed Description

Native, crash-consistent Timeline persistence sink.

Each committed revision is a checksummed frame containing one canonical snapshot. A trailing partial frame is discarded during recovery; corruption before the trailing frame fails closed. Checkpoints replace the file through a durable temporary sibling and atomic rename. Public operations are synchronous and perform filesystem I/O, so they must not run on an audio thread. A path can have at most one live FileJournal in the process, including aliases that resolve to the same file.

Constructor & Destructor Documentation

◆ ~FileJournal()

pulp::timeline::FileJournal::~FileJournal ( )
override

Flushes no additional state and releases the file and lifetime locks.

◆ FileJournal()

pulp::timeline::FileJournal::FileJournal ( const FileJournal & )
delete

Member Function Documentation

◆ append_batch()

runtime::Result< bool, JournalSinkError > pulp::timeline::FileJournal::append_batch ( const JournalEntry & entry)
overridevirtualnoexcept

Durably appends the entry's resulting canonical snapshot frame.

Implements pulp::timeline::JournalSink.

◆ checkpoint()

runtime::Result< bool, JournalSinkError > pulp::timeline::FileJournal::checkpoint ( const Project & snapshot,
DocumentRevision durable_revision )
overridevirtualnoexcept

Atomically replaces durable history with snapshot at durable_revision.

Implements pulp::timeline::JournalSink.

◆ open()

runtime::Result< FileJournalOpenResult, FileJournalError > pulp::timeline::FileJournal::open ( const std::filesystem::path & path,
Project fallback,
SchemaRegistry registry,
const FileJournalLimits & limits = {} )
static

Opens, creates, or recovers a journal at path.

A new or empty journal is initialized from fallback at revision zero. Existing complete frames are validated and the newest snapshot is returned. A torn trailing frame is truncated only after the valid prefix is recovered; non-tail corruption fails closed. registry is retained by value for subsequent canonical serialization.

Returns
An open sink and recovered checkpoint, or a bounded, path-alias, format, revision, durability, or I/O failure.

◆ operator=()

FileJournal & pulp::timeline::FileJournal::operator= ( const FileJournal & )
delete

◆ validate_restore()

runtime::Result< bool, JournalSinkError > pulp::timeline::FileJournal::validate_restore ( const Project & snapshot,
DocumentRevision durable_revision )
overridevirtualnoexcept

Compares snapshot and revision with the sink's recovered durable state.

This operation does not truncate or rewrite the file.

Reimplemented from pulp::timeline::JournalSink.


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