27#ifndef GENERIC_PROGRESS_REPORTER_H
28#define GENERIC_PROGRESS_REPORTER_H
52 void AddPhases(
int aNumPhases )
override;
57 virtual void BeginPhase(
int aPhase )
override;
67 virtual void AdvancePhase(
const wxString& aMessage )
override;
72 virtual void Report(
const wxString& aMessage )
override;
106 void SetTitle(
const wxString& aTitle )
override { }
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.
virtual bool updateUI()=0
void AdvanceProgress() override
Increment the progress bar length (inside the current virtual zone).
std::atomic_bool m_messageChanged
virtual void AdvancePhase() override
Use the next available virtual zone of the dialog progress bar.
void SetTitle(const wxString &aTitle) override
Change the title displayed on the window caption.
virtual void SetCurrentProgress(double aProgress) override
Set the progress value to aProgress (0..1).
std::atomic_int m_numPhases
void SetMaxProgress(int aMaxProgress) override
Fix the value that gives the 100 percent progress bar length (inside the current virtual zone).
PROGRESS_REPORTER_BASE(const PROGRESS_REPORTER_BASE &)=delete
std::atomic_bool m_cancelled
virtual ~PROGRESS_REPORTER_BASE()
std::atomic_int m_progress
virtual void Report(const wxString &aMessage) override
Display aMessage in the progress bar dialog.
void AddPhases(int aNumPhases) override
bool IsCancelled() const override
void SetNumPhases(int aNumPhases) override
Set the number of phases.
bool KeepRefreshing(bool aWait=false) override
Update the UI dialog.
std::atomic_int m_maxProgress
int currentProgress() const
virtual void BeginPhase(int aPhase) override
Initialize the aPhase virtual zone of the dialog progress bar.
A progress reporter interface for use in multi-threaded environments.