#include <ab_compare.hpp>
|
| enum class | Slot { A = 0
, B = 1
} |
|
| | ABCompare (state::StateStore *store) |
| Slot | current () const |
| | Which slot is currently live (i.e.
|
| void | save_to (Slot slot) |
| | Capture the StateStore's current state into slot.
|
| bool | load_from (Slot slot) |
| | Restore the StateStore from slot.
|
| bool | toggle () |
| | Toggle between A and B. Fails if the target slot has no snapshot.
|
| void | copy (Slot src, Slot dst) |
| | Overwrite dst with a copy of src's snapshot.
|
| void | swap () |
| | Swap A and B.
|
| bool | has (Slot slot) const |
| | Does slot currently hold a snapshot?
|
| void | clear (Slot slot) |
| | Drop any saved snapshot from slot.
|
| std::span< const uint8_t > | snapshot (Slot slot) const |
| | Raw snapshot bytes (exposed for serialization of the A/B pair itself — e.g.
|
◆ Slot
◆ ABCompare()
◆ clear()
| void pulp::view::ABCompare::clear |
( |
Slot | slot | ) |
|
|
inline |
Drop any saved snapshot from slot.
◆ copy()
| void pulp::view::ABCompare::copy |
( |
Slot | src, |
|
|
Slot | dst ) |
|
inline |
Overwrite dst with a copy of src's snapshot.
Useful when a user wants "start B from A and tweak".
◆ current()
| Slot pulp::view::ABCompare::current |
( |
| ) |
const |
|
inline |
Which slot is currently live (i.e.
what the StateStore was last switched to). Defaults to A.
◆ has()
| bool pulp::view::ABCompare::has |
( |
Slot | slot | ) |
const |
|
inline |
Does slot currently hold a snapshot?
◆ load_from()
| bool pulp::view::ABCompare::load_from |
( |
Slot | slot | ) |
|
|
inline |
Restore the StateStore from slot.
Call once at startup to prime an initial snapshot before any user edits; subsequent load_from calls drive the A/B toggle itself.
◆ save_to()
| void pulp::view::ABCompare::save_to |
( |
Slot | slot | ) |
|
|
inline |
Capture the StateStore's current state into slot.
◆ snapshot()
| std::span< const uint8_t > pulp::view::ABCompare::snapshot |
( |
Slot | slot | ) |
const |
|
inline |
Raw snapshot bytes (exposed for serialization of the A/B pair itself — e.g.
persisting A/B across session reloads).
◆ swap()
| void pulp::view::ABCompare::swap |
( |
| ) |
|
|
inline |
◆ toggle()
| bool pulp::view::ABCompare::toggle |
( |
| ) |
|
|
inline |
Toggle between A and B. Fails if the target slot has no snapshot.
The documentation for this class was generated from the following file:
- /home/runner/work/pulp/pulp/core/view/include/pulp/view/ab_compare.hpp