Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
pulp::format::reload::SwapUnit Class Referenceabstract

The contract a swappable subsystem implements to join a live-swap transaction More...

#include <live_swap_transaction.hpp>

Public Member Functions

virtual ~SwapUnit ()=default
virtual std::string name () const =0
 Human-readable identity, surfaced in LiveSwapResult::failed_stage.
virtual SwapStage to_stage ()=0
 Build the stage for this unit's pending swap, capturing the current state for rollback.

Detailed Description

The contract a swappable subsystem implements to join a live-swap transaction

A SwapUnit is anything that can be swapped as one half of a unified reload — DSP (a ReloadSession), scripted UI (a ScriptedUiSession), or a future GPU-resource unit. It produces a SwapStage that captures its current state for rollback at the moment to_stage() is called; the transaction then applies the stages in order and unwinds on failure (see apply_live_swap).

Implementations MUST honor the same atomicity + ordering contract as SwapStage: apply leaves no partial state on failure, and units are handed to the transaction easiest-to-roll-back first so the hardest-to-undo unit is last. to_stage() is expected to snapshot the pre-swap state now (e.g. the current UI code + widget values, or "keep the current processor") so the returned rollback can restore it if a LATER unit fails.

Constructor & Destructor Documentation

◆ ~SwapUnit()

virtual pulp::format::reload::SwapUnit::~SwapUnit ( )
virtualdefault

Member Function Documentation

◆ name()

virtual std::string pulp::format::reload::SwapUnit::name ( ) const
pure virtual

◆ to_stage()

virtual SwapStage pulp::format::reload::SwapUnit::to_stage ( )
pure virtual

Build the stage for this unit's pending swap, capturing the current state for rollback.

Called once per transaction, before any stage is applied.

Implemented in pulp::format::reload::DspReloadSwapUnit, and pulp::format::reload::ScriptedUiSwapUnit.


The documentation for this class was generated from the following file: