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 ()
- Public Member Functions inherited from frepple::utils::Command
 Command ()
virtual ~Command ()

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 3896 of file utils.h.


Constructor & Destructor Documentation

frepple::utils::CommandList::CommandList ( )
inlineexplicit

Default constructor.

Definition at line 3984 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 111 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 36 of file utils/actions.cpp.

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

Returns an iterator over all commands in the list.

Definition at line 3952 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 86 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 3981 of file utils.h.

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

Returns an iterator beyond the last command.

Definition at line 3955 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 103 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 56 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 75 of file utils/actions.cpp.


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