|
Deki 1.3.0
Modular C++ 2D engine for embedded displays and desktop
|
Base interface for undoable commands. More...
#include <Command.h>
Inherited by DekiEditor::CompoundCommand.
Public Member Functions | |
| virtual | ~Command ()=default |
| virtual std::string | GetDescription () const =0 |
| Human-readable description for UI display. | |
| virtual void | Execute ()=0 |
| Execute the command. | |
| virtual void | Undo ()=0 |
| Undo the command. | |
| virtual void | Redo () |
| Redo the command (default: calls Execute). | |
| virtual bool | CanMerge (const Command *other) const |
| Check if this command can merge with another. | |
| virtual void | Merge (const Command *other) |
| Merge another command into this one. | |
| virtual bool | ReferencesAny (const DeadMemory &dead) const |
| Report whether this command holds a raw pointer to anything in dead. | |
Base interface for undoable commands.
|
virtualdefault |
|
pure virtual |
Human-readable description for UI display.
Implemented in DekiEditor::CompoundCommand.
|
pure virtual |
Execute the command.
Implemented in DekiEditor::CompoundCommand.
|
pure virtual |
Undo the command.
Implemented in DekiEditor::CompoundCommand.
|
inlinevirtual |
Redo the command (default: calls Execute).
Reimplemented in DekiEditor::CompoundCommand.
|
inlinevirtual |
Check if this command can merge with another.
|
inlinevirtual |
Merge another command into this one.
|
inlinevirtual |
Report whether this command holds a raw pointer to anything in dead.
CommandHistory calls this when the scene is about to free objects, and discards any command that answers true — running Undo()/Redo() on a command whose target has been freed is a use-after-free.
The default is false, which is correct for commands that address their target by value or by id. Any command storing a DekiObject*, DekiComponent*, or Scene* MUST override this; see the implementations in src/core/commands/ for the pattern.
Reimplemented in DekiEditor::CompoundCommand.