Base class for background data generation jobs used by QmitkDataGeneratorBase and derived classes.
More...
#include <QmitkDataGenerationJobBase.h>
|
| using | ResultMapType = std::map< std::string, mitk::BaseData::Pointer > |
| | Map type for results produced by the job. More...
|
| |
Base class for background data generation jobs used by QmitkDataGeneratorBase and derived classes.
This class combines QObject (for signal/slot communication) and QRunnable (for thread pool execution) to provide a foundation for asynchronous data generation tasks. Derived classes implement RunComputation() to perform the actual work. The run() method handles error management, sets status flags, and emits appropriate signals when results are available or errors occur.
- See also
- QmitkDataGeneratorBase
-
QmitkImageStatisticsCalculationRunnable
Definition at line 39 of file QmitkDataGenerationJobBase.h.
◆ ResultMapType
Map type for results produced by the job.
The key is a job-specific label identifying each result (e.g. "statistics"), and the value is the corresponding mitk::BaseData output.
Definition at line 50 of file QmitkDataGenerationJobBase.h.
◆ QmitkDataGenerationJobBase()
| QmitkDataGenerationJobBase::QmitkDataGenerationJobBase |
( |
| ) |
|
|
protecteddefault |
◆ ~QmitkDataGenerationJobBase()
| virtual QmitkDataGenerationJobBase::~QmitkDataGenerationJobBase |
( |
| ) |
|
|
protectedvirtualdefault |
◆ Error
Emitted when an error occurs during computation.
- Parameters
-
| [in] | err | A human-readable error description. |
| [in] | job | Pointer to the job that encountered the error. |
◆ GetComputationSuccessFlag()
| bool QmitkDataGenerationJobBase::GetComputationSuccessFlag |
( |
| ) |
const |
Returns whether the last computation completed successfully.
- Returns
- True if RunComputation() returned true; false otherwise.
◆ GetLastErrorMessage()
| std::string QmitkDataGenerationJobBase::GetLastErrorMessage |
( |
| ) |
const |
Returns the error message from the last failed computation.
- Returns
- A string describing the last error, or an empty string if no error occurred.
◆ GetResults()
| virtual ResultMapType QmitkDataGenerationJobBase::GetResults |
( |
| ) |
const |
|
pure virtual |
◆ IsRunning()
| bool QmitkDataGenerationJobBase::IsRunning |
( |
| ) |
const |
Returns whether the job is currently executing.
- Returns
- True if run() is currently in progress; false otherwise.
◆ ResultsAvailable
Emitted when computation results are available.
- Parameters
-
| [in] | results | The map of labeled results produced by the job. |
| [in] | job | Pointer to the job that produced the results. |
◆ run()
| void QmitkDataGenerationJobBase::run |
( |
| ) |
|
|
final |
Executes the job computation with error handling and result signalling.
Calls RunComputation() internally. On success, emits ResultsAvailable with the computed results. On failure or exception, emits Error with a descriptive message. This method is marked final and should not be overridden; override RunComputation() instead.
◆ RunComputation()
| virtual bool QmitkDataGenerationJobBase::RunComputation |
( |
| ) |
|
|
protectedpure virtual |
◆ m_LastErrorMessage
| std::string QmitkDataGenerationJobBase::m_LastErrorMessage |
|
protected |
The documentation for this class was generated from the following file: