25#ifndef BACKGROUND_JOBS_MONITOR_H
26#define BACKGROUND_JOBS_MONITOR_H
32#include <shared_mutex>
49 std::shared_ptr<BACKGROUND_JOB> aJob );
51 void SetTitle(
const wxString& aTitle )
override
55 void Report(
const wxString& aMessage )
override;
57 void Cancel() { m_cancelled.store(
true ); }
67 std::shared_ptr<BACKGROUND_JOB>
m_job;
98 std::shared_ptr<BACKGROUND_JOB> Create(
const wxString& aName );
103 void Remove( std::shared_ptr<BACKGROUND_JOB> job );
108 void ShowList( wxWindow* aParent, wxPoint aPos );
118 void UnregisterStatusBar(
KISTATUSBAR* aStatusBar );
124 void onListWindowClosed( wxCloseEvent& aEvent );
129 void jobUpdated( std::shared_ptr<BACKGROUND_JOB> aJob );
136 std::vector<std::shared_ptr<BACKGROUND_JOB>>
m_jobs;
std::vector< std::shared_ptr< BACKGROUND_JOB > > m_jobs
Holds a reference to all active background jobs Access to this vector should be protected by locks si...
std::shared_mutex m_mutex
Mutex to protect access to the m_jobs vector.
std::vector< KISTATUSBAR * > m_statusBars
std::vector< BACKGROUND_JOB_LIST * > m_shownDialogs
std::shared_ptr< BACKGROUND_JOB > m_job
BACKGROUND_JOBS_MONITOR * m_monitor
void SetTitle(const wxString &aTitle) override
Change the title displayed on the window caption.
KISTATUSBAR is a wxStatusBar suitable for Kicad manager.
This implements all the tricky bits for thread safety, but the GUI is left to derived classes.
virtual bool updateUI()=0
virtual void AdvancePhase() override
Use the next available virtual zone of the dialog progress bar.
virtual void Report(const wxString &aMessage) override
Display aMessage in the progress bar dialog.
void SetNumPhases(int aNumPhases) override
Set the number of phases.
A progress reporter interface for use in multi-threaded environments.
std::shared_ptr< BACKGROUND_JOB_REPORTER > m_reporter