casa  5.7.0-16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
casa::TBActionList Class Reference

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

#include <TBAction.h>

Public Member Functions

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

Private Attributes

std::vector< TBAction * > actions
 Performed actions list. More...
 
std::vector< TBAction * > undone
 Undone actions list. More...
 

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 111 of file TBAction.h.

Constructor & Destructor Documentation

casa::TBActionList::TBActionList ( )

Default Constructor to initialize the empty lists.

casa::TBActionList::~TBActionList ( )

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.

Result casa::TBActionList::doAction ( TBAction action)

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

bool casa::TBActionList::isEmpty ( )

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

casacore::String casa::TBActionList::lastActionName ( )

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

casacore::String casa::TBActionList::lastUndoneActionName ( )

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

Result casa::TBActionList::redoAction ( )

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

bool casa::TBActionList::remove ( TBAction a)

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

Returns true if the remove was successful, false otherwise.

bool casa::TBActionList::removeUndone ( TBAction a)

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

Returns true if the remove was successful, false otherwise.

int casa::TBActionList::size ( )

Returns the size of the performed list.

Result casa::TBActionList::undoAction ( )

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.

bool casa::TBActionList::undoneIsEmpty ( )

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

int casa::TBActionList::undoneSize ( )

Returns the size of the undone list.

Member Data Documentation

std::vector<TBAction*> casa::TBActionList::actions
private

Performed actions list.

Definition at line 185 of file TBAction.h.

std::vector<TBAction*> casa::TBActionList::undone
private

Undone actions list.

Definition at line 189 of file TBAction.h.


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