casa
5.7.0-16
|
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... | |
TBAction * | at (unsigned int i) |
Returns the performed action at the designated index, or NULL if the index is invalid. More... | |
TBAction * | undoneAt (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... | |
Contains an list of performed actions and a list of undone actions.
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.
casa::TBActionList::TBActionList | ( | ) |
Default Constructor to initialize the empty lists.
casa::TBActionList::~TBActionList | ( | ) |
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.
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.
|
private |
Performed actions list.
Definition at line 185 of file TBAction.h.
|
private |
Undone actions list.
Definition at line 189 of file TBAction.h.