CustusX  2023.01.05-dev+develop.0da12
An IGT application
cx::TimedBaseAlgorithm Class Referenceabstract

Base class for algorithms that wants to time their execution. More...

#include <cxTimedAlgorithm.h>

Inheritance diagram for cx::TimedBaseAlgorithm:
cx::CompositeTimedAlgorithm cx::ElastixExecuter cx::ThreadedTimedAlgorithm< T > cx::ThreadedTimedAlgorithm< bool > cx::ThreadedTimedAlgorithm< QString > cx::ThreadedTimedAlgorithm< void > cx::ThreadedTimedAlgorithm< vtkImageDataPtr > cx::CompositeParallelTimedAlgorithm cx::CompositeSerialTimedAlgorithm cx::FilterTimedAlgorithm cx::Example cx::ThreadedTimedReconstructCore cx::ThreadedTimedReconstructPreprocessor cx::ConnectedThresholdImageFilter

Signals

void aboutToStart ()
 emitted at start of execute. Use to perform preprocessing More...
 
void started (int maxSteps)
 emitted at start of run. More...
 
void finished ()
 should be emitted when at the end of postProcessingSlot More...
 
void productChanged ()
 emitted whenever product string has changed More...
 

Public Member Functions

 TimedBaseAlgorithm (QString product, int secondsBetweenAnnounce)
 
virtual ~TimedBaseAlgorithm ()
 
virtual QString getProduct () const
 
virtual void execute ()=0
 
virtual bool isFinished () const =0
 
virtual bool isRunning () const =0
 

Protected Slots

virtual void finishedSlot ()
 
virtual void postProcessingSlot ()
 

Protected Member Functions

void startTiming ()
 
void stopTiming ()
 
QString getSecondsPassedAsString () const
 

Protected Attributes

bool mUseDefaultMessages
 

Detailed Description

Base class for algorithms that wants to time their execution.

Date
Feb 16, 2011
Author
Janne Beate Bakeng, SINTEF

Definition at line 40 of file cxTimedAlgorithm.h.

Constructor & Destructor Documentation

cx::TimedBaseAlgorithm::TimedBaseAlgorithm ( QString  product,
int  secondsBetweenAnnounce 
)

Definition at line 25 of file cxTimedAlgorithm.cpp.

cx::TimedBaseAlgorithm::~TimedBaseAlgorithm ( )
virtual

Definition at line 35 of file cxTimedAlgorithm.cpp.

Member Function Documentation

void cx::TimedBaseAlgorithm::aboutToStart ( )
signal

emitted at start of execute. Use to perform preprocessing

virtual void cx::TimedBaseAlgorithm::execute ( )
pure virtual

Execute the algorithm. Parts of the execution can be in another thread, thus the call usually returns after preprocessing is complete. The exec starts by emitting aboutToStart(), which can be used by callers to set input arguments.

Implemented in cx::CompositeParallelTimedAlgorithm, cx::ElastixExecuter, cx::CompositeSerialTimedAlgorithm, cx::ThreadedTimedAlgorithm< T >, cx::ThreadedTimedAlgorithm< QString >, cx::ThreadedTimedAlgorithm< void >, cx::ThreadedTimedAlgorithm< vtkImageDataPtr >, cx::ThreadedTimedAlgorithm< bool >, and cx::ConnectedThresholdImageFilter.

void cx::TimedBaseAlgorithm::finished ( )
signal

should be emitted when at the end of postProcessingSlot

virtual void cx::TimedBaseAlgorithm::finishedSlot ( )
inlineprotectedvirtualslot

Definition at line 81 of file cxTimedAlgorithm.h.

virtual QString cx::TimedBaseAlgorithm::getProduct ( ) const
inlinevirtual
QString cx::TimedBaseAlgorithm::getSecondsPassedAsString ( ) const
protected

Definition at line 61 of file cxTimedAlgorithm.cpp.

virtual bool cx::TimedBaseAlgorithm::isRunning ( ) const
pure virtual
virtual void cx::TimedBaseAlgorithm::postProcessingSlot ( )
inlineprotectedvirtualslot
void cx::TimedBaseAlgorithm::productChanged ( )
signal

emitted whenever product string has changed

void cx::TimedBaseAlgorithm::started ( int  maxSteps)
signal

emitted at start of run.

Parameters
maxStepsis an input to a QProgressBar, set to zero if unknown.
void cx::TimedBaseAlgorithm::startTiming ( )
protected

Definition at line 38 of file cxTimedAlgorithm.cpp.

void cx::TimedBaseAlgorithm::stopTiming ( )
protected

Definition at line 46 of file cxTimedAlgorithm.cpp.

Member Data Documentation

bool cx::TimedBaseAlgorithm::mUseDefaultMessages
protected

Definition at line 76 of file cxTimedAlgorithm.h.


The documentation for this class was generated from the following files: