SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
analysishost.h
Go to the documentation of this file.
1#ifndef ANALYSISHOST_H
2#define ANALYSISHOST_H
3
4#include <string>
5
7
28{
29public:
30 virtual ~AnalysisHost() = default;
31
41 virtual void ShowWarning(const std::string& message) = 0;
42
54 virtual ProgressReporter* CreateProgressReporter(int number_of_panels = 1,
55 bool extra_label_and_progressbar = false) = 0;
56
64 virtual void DisposeProgressReporter(ProgressReporter* reporter) = 0;
65};
66
77{
78public:
80 int number_of_panels = 1,
81 bool extra_label_and_progressbar = false)
82 : host_(host),
83 reporter_(host ? host->CreateProgressReporter(number_of_panels,
84 extra_label_and_progressbar)
85 : nullptr)
86 {
87 }
88
94
97
98 ProgressReporter* Get() const { return reporter_; }
100 operator ProgressReporter*() const { return reporter_; }
101
102private:
105};
106
107#endif // ANALYSISHOST_H
Abstract environment that an analysis runs inside.
virtual ~AnalysisHost()=default
virtual void ShowWarning(const std::string &message)=0
Reports a condition that prevented an analysis from running.
virtual void DisposeProgressReporter(ProgressReporter *reporter)=0
Releases a reporter previously obtained from this host.
virtual ProgressReporter * CreateProgressReporter(int number_of_panels=1, bool extra_label_and_progressbar=false)=0
Creates a progress reporter for a long-running analysis.
Abstract sink for progress information produced by a running analysis.
Holds a progress reporter for the duration of one analysis.
ScopedProgressReporter(AnalysisHost *host, int number_of_panels=1, bool extra_label_and_progressbar=false)
ScopedProgressReporter(const ScopedProgressReporter &)=delete
ScopedProgressReporter & operator=(const ScopedProgressReporter &)=delete
ProgressReporter * Get() const
ProgressReporter * operator->() const
ProgressReporter * reporter_