casa
5.7.0-16
|
#include <ThreadController.h>
Public Member Functions | |
ThreadController (ProgressMonitor *progress, PMSPTMethod postThreadMethod=NULL, PMSPTObject postThreadObject=NULL) | |
Constructor which takes the progress widget to use, and an optional post-thread method that should be called when the thread is finished. More... | |
virtual | ~ThreadController () |
virtual void | setError (const casacore::String &errorMessage) |
virtual void | setStatus (const casacore::String &status) |
Allows the cache to set the status. More... | |
virtual void | setProgress (unsigned int progress) |
Allows the cache to set the progress. More... | |
virtual void | finished () |
Thread signals it is done. More... | |
virtual void | initializeProgress (const casacore::String &operationName) |
These signals are used to update the QtProgressWidget across different threads. More... | |
virtual void | setProgress (unsigned int progress, const casacore::String &status) |
virtual void | finishProgress () |
virtual void | setAllowedOperations (bool background, bool pauseResume, bool cancel) |
Work classes can specify whether they support background operation, pause/resume, and cancelling. More... | |
virtual bool | wasCanceled () const |
Callback for classes doing the work to check whether they should cancel what they are doing or not. More... | |
void | setWorkThread (BackgroundThread *workThread) |
virtual void | background () |
For when the user requests "background" for the thread. More... | |
virtual void | pause () |
For when the user requests "pause" for the thread. More... | |
virtual void | resume () |
For when the user requests "resume" for the thread. More... | |
virtual void | cancel () |
For when the user requests "cancel" for the thread. More... | |
virtual void | postThreadMethod () |
Executes the post-thread method as needed. More... | |
bool | getResult () const |
Returns the result of the background operation. More... | |
casacore::String | getError () const |
Returns any error from the background operation. More... | |
bool | isErrorWarning () const |
casacore::String | getErrorTitle () const |
PlotMSPlot * | getPlot () |
Protected Member Functions | |
void | startThread () |
Starts the thread. More... | |
Protected Member Functions inherited from casa::ThreadCommunication | |
ThreadCommunication () | |
virtual | ~ThreadCommunication () |
Protected Attributes | |
volatile bool | wasCanceled_ |
Flag for whether thread was canceled or not. More... | |
casacore::String | error |
Holds error messages. More... | |
casacore::String | errorTitle |
bool | errorWarning |
ProgressMonitor * | itsProgressWidget_ |
Progress widget. More... | |
PMSPTMethod * | itsPostThreadMethod_ |
Method/Object to run when thread is finished. More... | |
PMSPTObject | itsPostThreadObject_ |
Private Member Functions | |
ThreadController (const ThreadController &controller) | |
ThreadController | operator= (const ThreadController &other) |
Private Attributes | |
BackgroundThread * | bgThread |
Definition at line 44 of file ThreadController.h.
casa::ThreadController::ThreadController | ( | ProgressMonitor * | progress, |
PMSPTMethod | postThreadMethod = NULL , |
||
PMSPTObject | postThreadObject = NULL |
||
) |
Constructor which takes the progress widget to use, and an optional post-thread method that should be called when the thread is finished.
|
virtual |
|
private |
|
virtual |
For when the user requests "background" for the thread.
|
virtual |
For when the user requests "cancel" for the thread.
Reimplemented in casa::PlotMSDrawThread, and casa::PlotMSExportThread.
|
virtual |
Thread signals it is done.
Implements casa::ThreadCommunication.
Reimplemented in casa::PlotMSThread.
|
virtual |
Implements casa::ThreadCommunication.
Reimplemented in casa::PlotMSThread.
casacore::String casa::ThreadController::getError | ( | ) | const |
Returns any error from the background operation.
casacore::String casa::ThreadController::getErrorTitle | ( | ) | const |
PlotMSPlot* casa::ThreadController::getPlot | ( | ) |
bool casa::ThreadController::getResult | ( | ) | const |
Returns the result of the background operation.
|
virtual |
These signals are used to update the QtProgressWidget across different threads.
They shouldn't need to be used by other classes, even children.
Implements casa::ThreadCommunication.
Reimplemented in casa::PlotMSThread.
bool casa::ThreadController::isErrorWarning | ( | ) | const |
|
private |
|
virtual |
For when the user requests "pause" for the thread.
|
virtual |
Executes the post-thread method as needed.
Does nothing if a post-thread method was not set in the constructor.
|
virtual |
For when the user requests "resume" for the thread.
|
virtual |
Work classes can specify whether they support background operation, pause/resume,
and cancelling.
Implements casa::ThreadCommunication.
|
virtual |
Implements casa::ThreadCommunication.
|
virtual |
Allows the cache to set the progress.
Implements casa::ThreadCommunication.
Reimplemented in casa::PlotMSCacheThread.
|
virtual |
Implements casa::ThreadCommunication.
Reimplemented in casa::PlotMSThread.
|
virtual |
Allows the cache to set the status.
Implements casa::ThreadCommunication.
Reimplemented in casa::PlotMSCacheThread.
void casa::ThreadController::setWorkThread | ( | BackgroundThread * | workThread | ) |
|
protected |
Starts the thread.
|
virtual |
Callback for classes doing the work to check whether they should cancel what they are doing or not.
Implements casa::ThreadCommunication.
|
private |
Definition at line 142 of file ThreadController.h.
|
protected |
Holds error messages.
Definition at line 122 of file ThreadController.h.
|
protected |
Definition at line 123 of file ThreadController.h.
|
protected |
Definition at line 124 of file ThreadController.h.
|
protected |
Method/Object to run when thread is finished.
Definition at line 133 of file ThreadController.h.
|
protected |
Definition at line 134 of file ThreadController.h.
|
protected |
Progress widget.
Definition at line 129 of file ThreadController.h.
|
protected |
Flag for whether thread was canceled or not.
Definition at line 119 of file ThreadController.h.