#include <corecommand.h>

Inheritance diagram for dnai::commands::CoreCommand:
Inheritance graph
Collaboration diagram for dnai::commands::CoreCommand:
Collaboration graph

Public Types

using Event = std::function< void()>
 

Public Member Functions

 CoreCommand (QString const &name, bool save, Event const &exec, Event const &undo)
 
virtual ~CoreCommand ()=default
 
void execute () const override
 Execute the command. More...
 
void executeSave () override
 Save current state of the command for the reverse unExcute() More...
 
void unExcute () const override
 Reverse the execute() function. More...
 
- Public Member Functions inherited from dnai::commands::Command
 Command (const QString &name, bool save=false)
 
virtual QString infos () const override
 Get display info for this command. More...
 
virtual bool isSave () const override
 Is the command is in a save state. More...
 
const QString & name () const
 Get the command name. More...
 

Static Public Member Functions

static void Success ()
 
static void Error ()
 

Private Attributes

Event exec
 
Event undo
 

Static Private Attributes

static std::queue< CoreCommand * > commandQueue
 

Additional Inherited Members

- Protected Member Functions inherited from dnai::interfaces::ICommand
virtual ~ICommand ()=default
 
- Protected Attributes inherited from dnai::commands::Command
const QString m_name
 
const bool m_save
 

Member Typedef Documentation

using dnai::commands::CoreCommand::Event = std::function<void()>

Constructor & Destructor Documentation

dnai::commands::CoreCommand::CoreCommand ( QString const &  name,
bool  save,
Event const &  exec,
Event const &  undo 
)
virtual dnai::commands::CoreCommand::~CoreCommand ( )
virtualdefault

Member Function Documentation

void dnai::commands::CoreCommand::Error ( )
static
void dnai::commands::CoreCommand::execute ( ) const
overridevirtual

Execute the command.

Reimplemented from dnai::commands::Command.

void dnai::commands::CoreCommand::executeSave ( )
overridevirtual

Save current state of the command for the reverse unExcute()

Reimplemented from dnai::commands::Command.

void dnai::commands::CoreCommand::Success ( )
static
void dnai::commands::CoreCommand::unExcute ( ) const
overridevirtual

Reverse the execute() function.

Reimplemented from dnai::commands::Command.

Member Data Documentation

std::queue< CoreCommand * > dnai::commands::CoreCommand::commandQueue
staticprivate
Event dnai::commands::CoreCommand::exec
private
Event dnai::commands::CoreCommand::undo
private

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