DEKI/ENGINE docs
Deki 0.19.0
Modular C++ 2D engine for embedded displays and desktop
Loading...
Searching...
No Matches
DekiEditor::CompoundCommand Class Reference

Several commands undone and redone as one. More...

#include <C:/Users/kirby/Documents/Github/deki/deki-editor/deki-editor/include/deki-editor/Command.h>

Inherits DekiEditor::Command.

Public Member Functions

 CompoundCommand (const std::string &description, std::vector< std::unique_ptr< Command > > commands)
 CompoundCommand (const CompoundCommand &)=delete
CompoundCommand & operator= (const CompoundCommand &)=delete
std::string GetDescription () const override
 Human-readable text shown in the UI, in the editor's current language.
void Execute () override
void Undo () override
void Redo () override
 Calls Execute by default.
bool ReferencesAny (const DeadMemory &dead) const override
 Whether this command holds a raw pointer to anything in dead.
Public Member Functions inherited from DekiEditor::Command
virtual ~Command ()=default
virtual bool CanMerge (const Command *other) const
 Whether other can be folded into this command.
virtual void Merge (const Command *other)
 Folds other into this command.

Detailed Description

Several commands undone and redone as one.

Constructor & Destructor Documentation

◆ CompoundCommand() [1/2]

DekiEditor::CompoundCommand::CompoundCommand ( const std::string & description,
std::vector< std::unique_ptr< Command > > commands )
inlineexplicit

◆ CompoundCommand() [2/2]

DekiEditor::CompoundCommand::CompoundCommand ( const CompoundCommand & )
delete

Member Function Documentation

◆ operator=()

CompoundCommand & DekiEditor::CompoundCommand::operator= ( const CompoundCommand & )
delete

◆ GetDescription()

std::string DekiEditor::CompoundCommand::GetDescription ( ) const
inlineoverridevirtual

Human-readable text shown in the UI, in the editor's current language.

Implements DekiEditor::Command.

◆ Execute()

void DekiEditor::CompoundCommand::Execute ( )
inlineoverridevirtual

Implements DekiEditor::Command.

◆ Undo()

void DekiEditor::CompoundCommand::Undo ( )
inlineoverridevirtual

Implements DekiEditor::Command.

◆ Redo()

void DekiEditor::CompoundCommand::Redo ( )
inlineoverridevirtual

Calls Execute by default.

Reimplemented from DekiEditor::Command.

◆ ReferencesAny()

bool DekiEditor::CompoundCommand::ReferencesAny ( const DeadMemory & dead) const
inlineoverridevirtual

Whether this command holds a raw pointer to anything in dead.

CommandHistory asks this when the scene is about to free objects and discards any command that answers true, since Undo()/Redo() on a freed target is a use-after-free.

The default, false, is right for commands that address their target by value or by id. Any command storing a Deki::Object*, Deki::Component* or Scene* MUST override this; see src/core/commands/ for the pattern.

Reimplemented from DekiEditor::Command.


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