A container command to group a series of commands together. More...
#include <utils.h>
Classes | |
class | iterator |
Public Member Functions | |
void | add (Command *c) |
iterator | begin () const |
CommandList () | |
virtual void | commit () |
bool | empty () const |
iterator | end () const |
void | redo () |
virtual void | rollback () |
virtual void | undo () |
virtual | ~CommandList () |
![]() | |
Command () | |
virtual | ~Command () |
A container command to group a series of commands together.
This class implements the "composite" design pattern in order to get an efficient and intuitive hierarchical grouping of commands.
|
inlineexplicit |
|
virtual |
Destructor.
A commandlist should only be deleted when all of its commands have been committed or undone. If this is not the case a warning will be printed.
Definition at line 111 of file utils/actions.cpp.
void frepple::utils::CommandList::add | ( | Command * | c | ) |
Append an additional command to the end of the list.
Definition at line 36 of file utils/actions.cpp.
|
inline |
|
virtual |
Commits all actions on its list.
At the end it also clears the list of actions.
Reimplemented from frepple::utils::Command.
Definition at line 86 of file utils/actions.cpp.
|
inline |
|
inline |
|
virtual |
Redoes all actions on its list.
The list of actions is left intact, so the changes can still be undone.
Reimplemented from frepple::utils::Command.
Definition at line 103 of file utils/actions.cpp.
|
virtual |
Undoes all actions on the list.
At the end it also clears the list of actions.
Reimplemented from frepple::utils::Command.
Definition at line 56 of file utils/actions.cpp.
|
virtual |
Undoes all actions on its list.
The list of actions is left intact, so the changes can still be redone.
Reimplemented from frepple::utils::Command.
Definition at line 75 of file utils/actions.cpp.