What one open gesture may spend against the undo budget. More...
#include <gesture_budget.hpp>
Public Attributes | |
| std::size_t | step_bytes = 0 |
| What one step charges: its forward commands plus its inverse. | |
| std::size_t | steps = 0 |
| Steps admitted into one open group, counting the opening Begin. | |
What one open gesture may spend against the undo budget.
A gesture that streams Update steps coalesces them all into a single undo group, and DocumentSession charges each step retained_size(forward) + retained_size(inverse) on top of what the group already holds. The group stays open until its End, and the eviction loop advances only over groups that are closed, so nothing can be reclaimed to make room for it. Past the budget the next step is refused with ConflictCode::UndoFull — a drag that stops responding partway through rather than one that degrades.
Knowing steps up front is what lets an editor pick a strategy before it opens a gesture instead of discovering the ceiling mid-drag: stream while the count is comfortable, and hold the edit locally and commit one GesturePhase::Single on release when it is not. A Single edit is closed on admission and therefore immediately evictable, so that path has no step ceiling at all.
| std::size_t pulp::timeline_editor::UndoGestureBudget::step_bytes = 0 |
What one step charges: its forward commands plus its inverse.
| std::size_t pulp::timeline_editor::UndoGestureBudget::steps = 0 |
Steps admitted into one open group, counting the opening Begin.
Zero means the gesture cannot be opened at all: one step already exceeds the whole budget, and an open group has nothing to evict to make room. SIZE_MAX means nothing is charged, which no real command manages — every retained_size arm includes sizeof(T) — but an empty step does.