Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::format::plugin_state_io Namespace Reference

Classes

struct  RestoreDiagnosticPolicy
struct  RestoreDiagnostics

Typedefs

using EnvelopeMigrationFn

Enumerations

enum class  RestoreBlobFormat : uint8_t { unknown , legacy_state_store , envelope }
enum class  RestoreDiagnosticStatus : uint8_t {
  ok , empty_blob , unknown_format , truncated_envelope ,
  unsupported_envelope_version , envelope_migration_unavailable , payload_size_mismatch , crc_mismatch ,
  empty_store_payload , total_size_budget_exceeded , store_size_budget_exceeded , plugin_size_budget_exceeded
}

Functions

uint32_t current_envelope_version ()
const char * restore_diagnostic_status_name (RestoreDiagnosticStatus status) noexcept
RestoreDiagnostics inspect_restore_blob (std::span< const uint8_t > bytes, const RestoreDiagnosticPolicy &policy={}) noexcept
 Inspect a host-facing plugin state blob without mutating live plugin state.
bool register_envelope_migration (uint32_t from_version, uint32_t to_version, EnvelopeMigrationFn migration)
std::vector< uint8_t > serialize (const state::StateStore &store, const Processor &processor)
 Serialize the host-facing plugin state blob for a Processor.
bool deserialize (std::span< const uint8_t > bytes, state::StateStore &store, Processor &processor)
 Restore a host-facing plugin state blob.

Typedef Documentation

◆ EnvelopeMigrationFn

Initial value:
std::function<bool(std::span<const uint8_t> source,
std::vector<uint8_t>& destination)>

Enumeration Type Documentation

◆ RestoreBlobFormat

Enumerator
unknown 
legacy_state_store 
envelope 

◆ RestoreDiagnosticStatus

Enumerator
ok 
empty_blob 
unknown_format 
truncated_envelope 
unsupported_envelope_version 
envelope_migration_unavailable 
payload_size_mismatch 
crc_mismatch 
empty_store_payload 
total_size_budget_exceeded 
store_size_budget_exceeded 
plugin_size_budget_exceeded 

Function Documentation

◆ current_envelope_version()

uint32_t pulp::format::plugin_state_io::current_envelope_version ( )

◆ deserialize()

bool pulp::format::plugin_state_io::deserialize ( std::span< const uint8_t > bytes,
state::StateStore & store,
Processor & processor )

Restore a host-facing plugin state blob.

Accepts both legacy raw StateStore blobs and the combined envelope emitted by serialize(). On failure, the live StateStore is rolled back to its previous state before returning false.

◆ inspect_restore_blob()

RestoreDiagnostics pulp::format::plugin_state_io::inspect_restore_blob ( std::span< const uint8_t > bytes,
const RestoreDiagnosticPolicy & policy = {} )
nodiscardnoexcept

Inspect a host-facing plugin state blob without mutating live plugin state.

This performs structural validation, size-budget checks, and large-state / plugin-payload signaling so callers can decide whether restore and resource relink work should be dispatched asynchronously.

◆ register_envelope_migration()

bool pulp::format::plugin_state_io::register_envelope_migration ( uint32_t from_version,
uint32_t to_version,
EnvelopeMigrationFn migration )

◆ restore_diagnostic_status_name()

const char * pulp::format::plugin_state_io::restore_diagnostic_status_name ( RestoreDiagnosticStatus status)
nodiscardnoexcept

◆ serialize()

std::vector< uint8_t > pulp::format::plugin_state_io::serialize ( const state::StateStore & store,
const Processor & processor )

Serialize the host-facing plugin state blob for a Processor.

StateStore remains the parameter-only inner payload. When the processor exposes a non-empty plugin-owned blob, this helper wraps both payloads in a versioned outer envelope. When the plugin-owned blob is empty, the legacy raw StateStore blob is returned unchanged.