Abstract base class for all commands. More...
#include <utils.h>
Public Member Functions | |
Command () | |
virtual void | commit () |
virtual void | redo () |
virtual void | rollback () |
virtual void | undo () |
virtual | ~Command () |
Friends | |
class | CommandList |
class | CommandManager |
class | frepple::CommandMoveOperationPlan |
Abstract base class for all commands.
Command objects are designed for algorithms that need to keep track of their decision, efficiently undo them and redo them.
The key methods are:
|
inline |
|
inlinevirtual |
|
inlinevirtual |
This method makes the change permanent.
A couple of notes on how this method should be implemented by the subclasses:
Reimplemented in frepple::CommandMoveOperationPlan, frepple::CommandDeleteOperationPlan, frepple::CommandCreateOperationPlan, and frepple::utils::CommandList.
|
inlinevirtual |
This method reproduces a previously undone change.
A couple of notes on how this method should be implemented by the subclasses:
Reimplemented in frepple::CommandMoveOperationPlan, frepple::CommandDeleteOperationPlan, frepple::CommandCreateOperationPlan, and frepple::utils::CommandList.
|
inlinevirtual |
This method permanently undoes the change.
A couple of notes on how this method should be implemented by the subclasses:
Reimplemented in frepple::CommandMoveOperationPlan, frepple::CommandDeleteOperationPlan, frepple::CommandCreateOperationPlan, and frepple::utils::CommandList.
|
inlinevirtual |
This method temporarily undoes the change. The concrete subclasses most maintain information that enables redoing the changes efficiently.
A couple of notes on how this method should be implemented by the subclasses:
Reimplemented in frepple::CommandMoveOperationPlan, frepple::CommandDeleteOperationPlan, frepple::CommandCreateOperationPlan, and frepple::utils::CommandList.
|
friend |
|
friend |
Reimplemented in frepple::utils::CommandManager::Bookmark.
|
friend |