casa  $Rev:20696$
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Public Member Functions | Private Attributes
casa::TBActionList Class Reference

Contains an list of performed actions and a list of undone actions. More...

#include <TBAction.h>

List of all members.

Public Member Functions

 TBActionList ()
 Default Constructor to initialize the empty lists.
 ~TBActionList ()
bool isEmpty ()
 Returns true if the performed list is empty, false otherwise.
bool undoneIsEmpty ()
 Returns true if the undone list is empty, false otherwise.
int size ()
 Returns the size of the performed list.
int undoneSize ()
 Returns the size of the undone list.
String lastActionName ()
 Returns the name() value of the last performed action, or blank if there is none.
String lastUndoneActionName ()
 Returns the name() value of the last undone action, or blank if there is none.
TBActionat (unsigned int i)
 Returns the performed action at the designated index, or NULL if the index is invalid.
TBActionundoneAt (unsigned int i)
 Returns the undone action at the designated index, or NULL if the index is invalid.
Result doAction (TBAction *action)
 Adds the given TBAction to the performed list and calls the action's doAction() method.
Result undoAction ()
 Moves the latest performed action to the undone list and calls the action's undoAction() method.
Result redoAction ()
 Moves the latest undone action to the performed list and calls the action's doAction() method.
bool remove (TBAction *a)
 Removes the given action from the performed list, but does not delete it.
bool removeUndone (TBAction *a)
 Removes the given action from the undone list, but does not delete it.

Private Attributes

vector< TBAction * > actions
 Performed actions list.
vector< TBAction * > undone
 Undone actions list.

Detailed Description

Contains an list of performed actions and a list of undone actions.

Synopsis

A TBActionList keep track of performed and undone actions and provides methods to add and move actions between the two lists. The lists have a maximum length defined by TBConstants::MAX_ACTION_BUFFER; once this limit has been reached, old actions are discarded.

Definition at line 114 of file TBAction.h.


Constructor & Destructor Documentation

Default Constructor to initialize the empty lists.


Member Function Documentation

TBAction* casa::TBActionList::at ( unsigned int  i)

Returns the performed action at the designated index, or NULL if the index is invalid.

Adds the given TBAction to the performed list and calls the action's doAction() method.

Returns true if the performed list is empty, false otherwise.

Returns the name() value of the last performed action, or blank if there is none.

Returns the name() value of the last undone action, or blank if there is none.

Moves the latest undone action to the performed list and calls the action's doAction() method.

Removes the given action from the performed list, but does not delete it.

Returns true if the remove was successful, false otherwise.

Removes the given action from the undone list, but does not delete it.

Returns true if the remove was successful, false otherwise.

Returns the size of the performed list.

Moves the latest performed action to the undone list and calls the action's undoAction() method.

TBAction* casa::TBActionList::undoneAt ( unsigned int  i)

Returns the undone action at the designated index, or NULL if the index is invalid.

Returns true if the undone list is empty, false otherwise.

Returns the size of the undone list.


Member Data Documentation

Performed actions list.

Definition at line 188 of file TBAction.h.

Undone actions list.

Definition at line 192 of file TBAction.h.


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