#include <Command.h>
Inheritance diagram for TSE3::Cmd::Command:
Public Member Functions | |
virtual | ~Command () |
void | execute () |
void | undo () |
const std::string & | title () const |
bool | undoable () const |
bool | done () const |
Protected Member Functions | |
Command (const std::string &title, bool undoable=true) | |
virtual void | executeImpl ()=0 |
virtual void | undoImpl ()=0 |
void | setTitle (const std::string &title) |
A base class for implementing the 'Command' design pattern [Gof]
If you are implementing a new Command then inherit publicly from this class, implement the executeImpl() and undoImpl() methods and ensure that your constructor calls the Command protected constructor.
|
|
|
Create a Command with a descriptive string. This must begin with a lower case letter and be capable of following "Undo " or "Redo ".
|
|
Call this to execute the Command. If the Command has already been executed, nothing will happen.
|
|
Call this to undo the Command. If the Command can't be undone, or it has already been undone, then nothing will happen. |
|
Returns a descriptive string for the command. The string begins with a lower case letter and is capable of following "Undo " or "Redo ". |
|
Returns whether this Command is capable of being undone. |
|
Returns whether this command has been executed.
|
|
|
|
Sets the Command title. Normally you will do this in the ctor and never use this. |