Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
reload_swap_units.hpp
Go to the documentation of this file.
1#pragma once
2
11
14
15#include <string>
16#include <utility>
17
18namespace pulp::format::reload {
19
26public:
27 DspReloadSwapUnit(ReloadSession& session, std::string library_path,
28 std::string stage_name = "dsp")
29 : session_(session),
30 library_path_(std::move(library_path)),
31 name_(std::move(stage_name)) {}
32
33 std::string name() const override { return name_; }
34
35 SwapStage to_stage() override {
36 return SwapStage{
37 name_,
38 [this] {
39 last_ = session_.reload(library_path_);
40 return last_.ok();
41 },
42 // No-op: this stage is terminal in the transaction ordering (DSP last),
43 // and the reload is atomic on failure, so there is nothing to undo.
44 [] {}};
45 }
46
48 const ReloadOutcome& last_outcome() const { return last_; }
49
50private:
51 ReloadSession& session_;
52 std::string library_path_;
53 std::string name_;
54 ReloadOutcome last_{};
55};
56
57} // namespace pulp::format::reload
const ReloadOutcome & last_outcome() const
The outcome of the most recent apply() (valid after the transaction runs).
Definition reload_swap_units.hpp:48
std::string name() const override
Human-readable identity, surfaced in LiveSwapResult::failed_stage.
Definition reload_swap_units.hpp:33
DspReloadSwapUnit(ReloadSession &session, std::string library_path, std::string stage_name="dsp")
Definition reload_swap_units.hpp:27
SwapStage to_stage() override
Build the stage for this unit's pending swap, capturing the current state for rollback.
Definition reload_swap_units.hpp:35
Owns the session-stable state for a series of hot reloads of one plugin instance — the slot,...
Definition reload_transaction.hpp:407
The contract a swappable subsystem implements to join a live-swap transaction
Definition live_swap_transaction.hpp:102
One reload session = one atomic unit across UX + DSP.
Definition build_fingerprint.hpp:23
STL namespace.
The verify-before-commit reload transaction — ties the Phase-0 primitives into one operation: load a ...
Definition reload_transaction.hpp:63
One half of a live swap.
Definition live_swap_transaction.hpp:38