Donner 0.5.1
Embeddable browser-grade SVG2 engine
Loading...
Searching...
No Matches
donner::editor::CommandQueue Class Reference

Classes

struct  FlushResult

Public Member Functions

void push (EditorCommand command)
 Push a command onto the queue. UI thread only.
FlushResult flush ()
 Drain and coalesce the pending commands. Returns the effective set of commands to apply, in the order the application should issue them. After flush() returns, the queue is empty.
bool empty () const
 Whether the queue currently holds any pending commands. Useful for frame-skip optimizations (no need to re-render if nothing changed).
std::size_t size () const
 Number of un-coalesced commands currently pending. Coalescing happens at flush() time, so this is the raw count, not the effective count.
void clear ()
 Drop everything pending without applying. Useful for tests and for the "abort drag" cancel path.

Class Documentation

◆ donner::editor::CommandQueue::FlushResult

struct donner::editor::CommandQueue::FlushResult
Collaboration diagram for donner::editor::CommandQueue::FlushResult:
[legend]
Class Members
vector< EditorCommand > effectiveCommands
bool hadReplaceDocument = false True when any ReplaceDocument was drained from the raw pending batch.
bool preserveUndoOnReparse = false True only when the drained batch contained at least one ReplaceDocument and every drained ReplaceDocument carried the preserve-undo marker.

Member Function Documentation

◆ flush()

FlushResult donner::editor::CommandQueue::flush ( )
nodiscard

Drain and coalesce the pending commands. Returns the effective set of commands to apply, in the order the application should issue them. After flush() returns, the queue is empty.

flush() is called once per frame at the start of the main loop.


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