26 #ifndef THREADCONTROLLER_H_
27 #define THREADCONTROLLER_H_
34 class ProgressMonitor;
35 class BackgroundThread;
virtual void finished()
Thread signals it is done.
virtual void cancel()
For when the user requests "cancel" for the thread.
void setWorkThread(BackgroundThread *workThread)
void startThread()
Starts the thread.
PMSPTMethod * itsPostThreadMethod_
Method/Object to run when thread is finished.
virtual void postThreadMethod()
Executes the post-thread method as needed.
virtual bool wasCanceled() const
Callback for classes doing the work to check whether they should cancel what they are doing or not...
virtual void setAllowedOperations(bool background, bool pauseResume, bool cancel)
Work classes can specify whether they support background operation, pause/resume, and cancelling.
bool isErrorWarning() const
virtual void setError(const casacore::String &errorMessage)
casacore::String getErrorTitle() const
void * PMSPTObject
Typedefs for using post-thread methods.
ProgressMonitor * itsProgressWidget_
Progress widget.
casacore::String errorTitle
virtual void initializeProgress(const casacore::String &operationName)
These signals are used to update the QtProgressWidget across different threads.
virtual void pause()
For when the user requests "pause" for the thread.
virtual void setStatus(const casacore::String &status)
Allows the cache to set the status.
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...
ThreadController operator=(const ThreadController &other)
Abstraction for a display widget that can show the progress of an operation.
volatile bool wasCanceled_
Flag for whether thread was canceled or not.
casacore::String error
Holds error messages.
virtual void background()
For when the user requests "background" for the thread.
Class for a single "plot" concept.
virtual ~ThreadController()
BackgroundThread * bgThread
virtual void resume()
For when the user requests "resume" for the thread.
virtual void finishProgress()
void PMSPTMethod(PMSPTObject, bool)
virtual void setProgress(unsigned int progress)
Allows the cache to set the progress.
casacore::String getError() const
Returns any error from the background operation.
String: the storage and methods of handling collections of characters.
bool getResult() const
Returns the result of the background operation.
PMSPTObject itsPostThreadObject_
Manages a thread to do a background operation and communicates back to its controller with regard to ...
Defines communication mechanisms that the model and data can use to communicate with the UI concernin...