DISPLACE
1.0
A spatial model of fisheries to help sustainable fishing and maritime spatial planning
|
An abstract class that implements an interface for commands that can be undone and redone. More...
#include <command.h>
Public Member Functions | |
Command () | |
virtual | ~Command () |
virtual bool | execute ()=0 |
Execute the command. More... | |
virtual bool | undo ()=0 |
Undo the command. More... | |
virtual bool | redo ()=0 |
Redo the command. More... | |
An abstract class that implements an interface for commands that can be undone and redone.
This class imeplements a Command design pattern. Each command that can be undone and re-done must derive from this class.
Command::Command | ( | ) |
|
virtual |
|
pure virtual |
Execute the command.
If the command executed correctly, the client will put the command in the Undo list.
Implemented in SetTreeTypeCommand, and SetNodeValueCommand.
|
pure virtual |
Redo the command.
If the command redid correctly, the client will move it from the redo list to the undo list.
Implemented in SetTreeTypeCommand, and SetNodeValueCommand.
|
pure virtual |
Undo the command.
If the command undid correctly, the client will move the command in the Redo list. Otherwise the entire Undo list must be cleaned.
Implemented in SetTreeTypeCommand, and SetNodeValueCommand.