SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
AnalysisHost Class Referenceabstract

Abstract environment that an analysis runs inside. More...

#include <analysishost.h>

Collaboration diagram for AnalysisHost:
Collaboration graph

Public Member Functions

virtual ~AnalysisHost ()=default
 
virtual void ShowWarning (const std::string &message)=0
 Reports a condition that prevented an analysis from running.
 
virtual ProgressReporter * CreateProgressReporter (int number_of_panels=1, bool extra_label_and_progressbar=false)=0
 Creates a progress reporter for a long-running analysis.
 
virtual void DisposeProgressReporter (ProgressReporter *reporter)=0
 Releases a reporter previously obtained from this host.
 

Detailed Description

Abstract environment that an analysis runs inside.

The Conductor needs two things from the program it is running in: somewhere to report a problem that stops an analysis, and a way to obtain a progress reporter for a long-running one. In the graphical application those are a message box and a ProgressWindow; in the command line application they are console output and a text reporter. The Conductor is written against this interface so that it contains no reference to either.

The host owns every reporter it hands out. A caller that obtains one with CreateProgressReporter() must return it with DisposeProgressReporter() once the analysis is finished, and must not delete it directly.

Note
This header pulls in nothing from Qt, so it is usable from code that never creates a window
See also
ProgressReporter

Definition at line 27 of file analysishost.h.

Constructor & Destructor Documentation

◆ ~AnalysisHost()

virtual AnalysisHost::~AnalysisHost ( )
virtualdefault

Member Function Documentation

◆ CreateProgressReporter()

virtual ProgressReporter * AnalysisHost::CreateProgressReporter ( int  number_of_panels = 1,
bool  extra_label_and_progressbar = false 
)
pure virtual

Creates a progress reporter for a long-running analysis.

The returned reporter is owned by the host and remains valid until it is passed to DisposeProgressReporter().

Parameters
number_of_panelsNumber of progress charts the analysis will use
extra_label_and_progressbarWhether a second label and progress bar are needed, for analyses that report nested progress
Returns
Reporter to pass to the analysis, never nullptr

◆ DisposeProgressReporter()

virtual void AnalysisHost::DisposeProgressReporter ( ProgressReporter *  reporter)
pure virtual

Releases a reporter previously obtained from this host.

Passing nullptr is permitted and does nothing.

Parameters
reporterReporter to release; must not be used afterwards

Referenced by ScopedProgressReporter::~ScopedProgressReporter().

◆ ShowWarning()


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