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. | |
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.
|
virtualdefault |
|
pure virtual |
Human-readable identity, surfaced in LiveSwapResult::failed_stage.
Implemented in pulp::format::reload::DspReloadSwapUnit, and pulp::format::reload::ScriptedUiSwapUnit.
|
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.