casa::PlotMSThread Class Reference

Abstract class to control a threaded operation from the GUI. More...

#include <PlotMSThread.qo.h>

Inheritance diagram for casa::PlotMSThread:
casa::ThreadController casa::ThreadCommunication casa::PlotMSCacheThread casa::PlotMSDrawThread casa::PlotMSExportThread

List of all members.

Signals

void finishedOperation (PlotMSThread *thread)
 This signal MUST be emitted after start() has been called, and when the operation has finished.
void updateProgress (unsigned int value, const QString &statusStr)
void initProgress (const QString &operationName)
void finalizeProgress ()

Public Member Functions

 PlotMSThread (QtProgressWidget *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 ~PlotMSThread ()
 Destructor.
virtual void startOperation ()=0
 ABSTRACT METHODS //.
virtual void finished ()
 IMPLEMENTED METHODS //.
virtual void initializeProgress (const String &operationName)
 Overridden from BackgroundThread in order to update the progress widget on the GUI thread.
virtual void setProgress (unsigned int progress, const String &status)
virtual void finishProgress ()
int getId ()
virtual QString getName () const =0
virtual bool isCacheThread () const

Protected Slots

void cancelThread ()
 For when the user requests "cancel" for the thread.

Protected Member Functions

virtual void threadFinished ()
 Allows subclasses to override and do any clean-up they need to once the background thread has completed.
void signalFinishedOperation (PlotMSThread *thread)
 Signal that clean-up and thread work is done.

Private Slots

void backgroundThread ()
 For when the user requests "background" for the thread.
void pauseThread ()
 For when the user requests "pause" for the thread.
void resumeThread ()
 For when the user requests "resume" for the thread.

Private Attributes

int id

Detailed Description

Abstract class to control a threaded operation from the GUI.

Classes that want to run PlotMSThreads should: 1) Provide a QtProgressWidget in the main (GUI) thread. 2) Connect the finishedOperation() signal to a slot as needed. 3) Call startOperation() to start the thread. 4) Call the post-thread method after completion, if there is one.

Definition at line 44 of file PlotMSThread.qo.h.


Constructor & Destructor Documentation

casa::PlotMSThread::PlotMSThread ( QtProgressWidget 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 casa::PlotMSThread::~PlotMSThread (  )  [virtual]

Destructor.


Member Function Documentation

void casa::PlotMSThread::backgroundThread (  )  [private, slot]

For when the user requests "background" for the thread.

void casa::PlotMSThread::cancelThread (  )  [protected, slot]

For when the user requests "cancel" for the thread.

void casa::PlotMSThread::finalizeProgress (  )  [signal]
virtual void casa::PlotMSThread::finished (  )  [virtual]

IMPLEMENTED METHODS //.

Reimplemented from casa::ThreadController.

void casa::PlotMSThread::finishedOperation ( PlotMSThread thread  )  [signal]

This signal MUST be emitted after start() has been called, and when the operation has finished.

The thread parameter points to the thread that has just completed.

virtual void casa::PlotMSThread::finishProgress (  )  [virtual]

Reimplemented from casa::ThreadController.

int casa::PlotMSThread::getId (  ) 
virtual QString casa::PlotMSThread::getName (  )  const [pure virtual]
virtual void casa::PlotMSThread::initializeProgress ( const String &  operationName  )  [virtual]

Overridden from BackgroundThread in order to update the progress widget on the GUI thread.

Reimplemented from casa::ThreadController.

void casa::PlotMSThread::initProgress ( const QString &  operationName  )  [signal]
virtual bool casa::PlotMSThread::isCacheThread (  )  const [virtual]

Reimplemented in casa::PlotMSCacheThread.

void casa::PlotMSThread::pauseThread (  )  [private, slot]

For when the user requests "pause" for the thread.

void casa::PlotMSThread::resumeThread (  )  [private, slot]

For when the user requests "resume" for the thread.

virtual void casa::PlotMSThread::setProgress ( unsigned int  progress,
const String &  status 
) [virtual]

Reimplemented from casa::ThreadController.

void casa::PlotMSThread::signalFinishedOperation ( PlotMSThread thread  )  [protected]

Signal that clean-up and thread work is done.

virtual void casa::PlotMSThread::startOperation (  )  [pure virtual]

ABSTRACT METHODS //.

Abstract method which does the operation. IMPORTANT: subclasses MUST emit the finished() signal when finished.

Implemented in casa::PlotMSCacheThread, casa::PlotMSDrawThread, and casa::PlotMSExportThread.

virtual void casa::PlotMSThread::threadFinished (  )  [inline, protected, virtual]

Allows subclasses to override and do any clean-up they need to once the background thread has completed.

Reimplemented in casa::PlotMSCacheThread, and casa::PlotMSExportThread.

Definition at line 90 of file PlotMSThread.qo.h.

void casa::PlotMSThread::updateProgress ( unsigned int  value,
const QString &  statusStr 
) [signal]

Member Data Documentation

int casa::PlotMSThread::id [private]

Definition at line 109 of file PlotMSThread.qo.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 31 Aug 2016 for casa by  doxygen 1.6.1