frepple::utils::CommandList Class Reference

A container command to group a series of commands together. More...

#include <utils.h>

Inheritance diagram for frepple::utils::CommandList:

List of all members.

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 ()

Detailed Description

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.

Definition at line 3794 of file utils.h.


Constructor & Destructor Documentation

frepple::utils::CommandList::CommandList ( ) [inline, explicit]

Default constructor.

Definition at line 3882 of file utils.h.

frepple::utils::CommandList::~CommandList ( ) [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 118 of file utils/actions.cpp.


Member Function Documentation

void frepple::utils::CommandList::add ( Command c)

Append an additional command to the end of the list.

Definition at line 43 of file utils/actions.cpp.

iterator frepple::utils::CommandList::begin ( ) const [inline]

Returns an iterator over all commands in the list.

Definition at line 3850 of file utils.h.

void frepple::utils::CommandList::commit ( ) [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 93 of file utils/actions.cpp.

bool frepple::utils::CommandList::empty ( ) const [inline]

Returns true if no commands have been added yet to the list.

Definition at line 3879 of file utils.h.

iterator frepple::utils::CommandList::end ( ) const [inline]

Returns an iterator beyond the last command.

Definition at line 3853 of file utils.h.

void frepple::utils::CommandList::redo ( ) [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 110 of file utils/actions.cpp.

void frepple::utils::CommandList::rollback ( ) [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 63 of file utils/actions.cpp.

void frepple::utils::CommandList::undo ( ) [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 82 of file utils/actions.cpp.


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

Documentation generated for frePPLe by  doxygen