NorMIT-nav  22.09
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

◆ TimedBaseAlgorithm()

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

Definition at line 25 of file cxTimedAlgorithm.cpp.

◆ ~TimedBaseAlgorithm()

cx::TimedBaseAlgorithm::~TimedBaseAlgorithm ( )
virtual

Definition at line 35 of file cxTimedAlgorithm.cpp.

Member Function Documentation

◆ aboutToStart

void cx::TimedBaseAlgorithm::aboutToStart ( )
signal

emitted at start of execute. Use to perform preprocessing

◆ execute()

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.

◆ finished

void cx::TimedBaseAlgorithm::finished ( )
signal

should be emitted when at the end of postProcessingSlot

◆ finishedSlot

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

Definition at line 81 of file cxTimedAlgorithm.h.

◆ getProduct()

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

◆ getSecondsPassedAsString()

QString cx::TimedBaseAlgorithm::getSecondsPassedAsString ( ) const
protected

Definition at line 61 of file cxTimedAlgorithm.cpp.

◆ isFinished()

virtual bool cx::TimedBaseAlgorithm::isFinished ( ) const
pure virtual

◆ isRunning()

virtual bool cx::TimedBaseAlgorithm::isRunning ( ) const
pure virtual

Returns true if preprocess is started and postprocess not complete. (Right after aboutToStart, right before finished())

Implemented in cx::CompositeParallelTimedAlgorithm, cx::ElastixExecuter, cx::CompositeSerialTimedAlgorithm, and cx::ThreadedTimedAlgorithm< T >.

◆ postProcessingSlot

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

◆ productChanged

void cx::TimedBaseAlgorithm::productChanged ( )
signal

emitted whenever product string has changed

◆ started

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

emitted at start of run.

Parameters
maxStepsis an input to a QProgressBar, set to zero if unknown.

◆ startTiming()

void cx::TimedBaseAlgorithm::startTiming ( )
protected

Definition at line 38 of file cxTimedAlgorithm.cpp.

◆ stopTiming()

void cx::TimedBaseAlgorithm::stopTiming ( )
protected

Definition at line 46 of file cxTimedAlgorithm.cpp.

Member Data Documentation

◆ mUseDefaultMessages

bool cx::TimedBaseAlgorithm::mUseDefaultMessages
protected

Definition at line 76 of file cxTimedAlgorithm.h.


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