casa
5.7.0-16
|
Abstract parent class of any action that can be performed. More...
#include <TBAction.h>
Public Member Functions | |
TBAction (void *origin) | |
Constructor that takes a pointer to the origin object. More... | |
virtual | ~TBAction () |
void * | getOrigin () |
Returns a pointer to the origin object. More... | |
virtual Result | doAction ()=0 |
doAction() must be implemented by any subclass. More... | |
virtual Result | undoAction ()=0 |
undoAction() must be implemented by any subclass. More... | |
virtual casacore::String | name ()=0 |
name() must be implemented by any subclass. More... | |
virtual bool | isAssociatedWith (void *origin)=0 |
isAssociatedWith() must be implemented by any subclass. More... | |
Protected Attributes | |
void * | origin |
Pointer to origin object. More... | |
Abstract parent class of any action that can be performed.
Any editing change to the underlying table should be encapsulated in a TBAction. A TBAction subclass needs to be able to perform the designated action as well as knowing how to undo it. The specific implementation of performing the action is left up to the subclasses.
Definition at line 54 of file TBAction.h.
casa::TBAction::TBAction | ( | void * | origin | ) |
Constructor that takes a pointer to the origin object.
The origin is used to, for example, remove actions associated with objects that have been closed or otherwise made unavailable.
|
virtual |
|
pure virtual |
doAction() must be implemented by any subclass.
This method performs the action, updating both the backend and the GUI as necessary.
Implemented in casa::TBEditArrayDataAction, and casa::TBEditDataAction.
void* casa::TBAction::getOrigin | ( | ) |
Returns a pointer to the origin object.
|
pure virtual |
isAssociatedWith() must be implemented by any subclass.
This method returns true if this action is associated with the given origin object, false otherwise. If an action is associated with an object that is then closed (like a table or an array) then the action may be removed from the performed/undone queues.
Implemented in casa::TBEditArrayDataAction, and casa::TBEditDataAction.
|
pure virtual |
name() must be implemented by any subclass.
This method returns the name of the action. The name should be human-readable and does not have to be any specific format.
Implemented in casa::TBEditArrayDataAction, and casa::TBEditDataAction.
|
pure virtual |
undoAction() must be implemented by any subclass.
This method undoes the action, updating both the backend and the GUI as necessary.
Implemented in casa::TBEditArrayDataAction, and casa::TBEditDataAction.
|
protected |
Pointer to origin object.
Definition at line 97 of file TBAction.h.