KiCad PCB EDA Suite
Loading...
Searching...
No Matches
BACKGROUND_JOBS_MONITOR Class Reference

#include <background_jobs_monitor.h>

Public Member Functions

 BACKGROUND_JOBS_MONITOR ()
 
std::shared_ptr< BACKGROUND_JOBCreate (const wxString &aName)
 Creates a background job with the given name.
 
void Remove (std::shared_ptr< BACKGROUND_JOB > job)
 Removes the given background job from any lists and frees it.
 
void ShowList (wxWindow *aParent, wxPoint aPos)
 Shows the background job list.
 
void RegisterStatusBar (KISTATUSBAR *aStatusBar)
 Add a status bar for handling.
 
void UnregisterStatusBar (KISTATUSBAR *aStatusBar)
 Removes status bar from handling.
 

Private Member Functions

void onListWindowClosed (wxCloseEvent &aEvent)
 Handles removing the shown list window from our list of shown windows.
 
void jobUpdated (std::shared_ptr< BACKGROUND_JOB > aJob)
 Handles job status updates, intended to be called by BACKGROUND_JOB_REPORTER only.
 

Private Attributes

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 since threads may Create or Remove at will to register their activity.
 
std::vector< BACKGROUND_JOB_LIST * > m_shownDialogs
 
std::vector< KISTATUSBAR * > m_statusBars
 
std::shared_mutex m_mutex
 Mutex to protect access to the m_jobs vector.
 

Friends

class BACKGROUND_JOB_REPORTER
 
class BACKGROUND_JOB_LIST
 

Detailed Description

Definition at line 85 of file background_jobs_monitor.h.

Constructor & Destructor Documentation

◆ BACKGROUND_JOBS_MONITOR()

BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR ( )

Definition at line 214 of file background_jobs_monitor.cpp.

Referenced by BACKGROUND_JOB_LIST.

Member Function Documentation

◆ Create()

std::shared_ptr< BACKGROUND_JOB > BACKGROUND_JOBS_MONITOR::Create ( const wxString & aName)

Creates a background job with the given name.

Parameters
aNameis the displayed title for the event

Definition at line 220 of file background_jobs_monitor.cpp.

References BACKGROUND_JOB_LIST, m_jobs, m_mutex, and m_shownDialogs.

Referenced by BACKGROUND_JOB_LIST, UPDATE_MANAGER::CheckForUpdate(), and PLUGIN_CONTENT_MANAGER::RunBackgroundUpdate().

◆ jobUpdated()

void BACKGROUND_JOBS_MONITOR::jobUpdated ( std::shared_ptr< BACKGROUND_JOB > aJob)
private

Handles job status updates, intended to be called by BACKGROUND_JOB_REPORTER only.

Definition at line 326 of file background_jobs_monitor.cpp.

References BACKGROUND_JOB_LIST, m_jobs, m_mutex, m_shownDialogs, and m_statusBars.

Referenced by BACKGROUND_JOB_LIST, and Remove().

◆ onListWindowClosed()

void BACKGROUND_JOBS_MONITOR::onListWindowClosed ( wxCloseEvent & aEvent)
private

Handles removing the shown list window from our list of shown windows.

Definition at line 289 of file background_jobs_monitor.cpp.

References BACKGROUND_JOB_LIST, and m_shownDialogs.

Referenced by BACKGROUND_JOB_LIST, and ShowList().

◆ RegisterStatusBar()

void BACKGROUND_JOBS_MONITOR::RegisterStatusBar ( KISTATUSBAR * aStatusBar)

Add a status bar for handling.

Definition at line 364 of file background_jobs_monitor.cpp.

References m_statusBars.

Referenced by BACKGROUND_JOB_LIST, and EVT_MENU_RANGE().

◆ Remove()

void BACKGROUND_JOBS_MONITOR::Remove ( std::shared_ptr< BACKGROUND_JOB > job)

Removes the given background job from any lists and frees it.

Definition at line 247 of file background_jobs_monitor.cpp.

References BACKGROUND_JOB_LIST, jobUpdated(), m_jobs, m_mutex, m_shownDialogs, and m_statusBars.

Referenced by BACKGROUND_JOB_LIST, UPDATE_MANAGER::CheckForUpdate(), and UPDATE_CANCELLER::~UPDATE_CANCELLER().

◆ ShowList()

void BACKGROUND_JOBS_MONITOR::ShowList ( wxWindow * aParent,
wxPoint aPos )

Shows the background job list.

Definition at line 303 of file background_jobs_monitor.cpp.

References BACKGROUND_JOB_LIST, m_jobs, m_mutex, m_shownDialogs, and onListWindowClosed().

Referenced by BACKGROUND_JOB_LIST, and KISTATUSBAR::onBackgroundProgressClick().

◆ UnregisterStatusBar()

void BACKGROUND_JOBS_MONITOR::UnregisterStatusBar ( KISTATUSBAR * aStatusBar)

Removes status bar from handling.

Definition at line 370 of file background_jobs_monitor.cpp.

References m_statusBars.

Referenced by BACKGROUND_JOB_LIST, and KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME().

Friends And Related Symbol Documentation

◆ BACKGROUND_JOB_LIST

◆ BACKGROUND_JOB_REPORTER

friend class BACKGROUND_JOB_REPORTER
friend

Definition at line 87 of file background_jobs_monitor.h.

References BACKGROUND_JOB_REPORTER.

Referenced by BACKGROUND_JOB_REPORTER.

Member Data Documentation

◆ m_jobs

std::vector<std::shared_ptr<BACKGROUND_JOB> > BACKGROUND_JOBS_MONITOR::m_jobs
private

Holds a reference to all active background jobs Access to this vector should be protected by locks since threads may Create or Remove at will to register their activity.

Definition at line 136 of file background_jobs_monitor.h.

Referenced by Create(), jobUpdated(), Remove(), and ShowList().

◆ m_mutex

std::shared_mutex BACKGROUND_JOBS_MONITOR::m_mutex
mutableprivate

Mutex to protect access to the m_jobs vector.

Definition at line 142 of file background_jobs_monitor.h.

Referenced by Create(), jobUpdated(), Remove(), and ShowList().

◆ m_shownDialogs

std::vector<BACKGROUND_JOB_LIST*> BACKGROUND_JOBS_MONITOR::m_shownDialogs
private

Definition at line 137 of file background_jobs_monitor.h.

Referenced by Create(), jobUpdated(), onListWindowClosed(), Remove(), and ShowList().

◆ m_statusBars

std::vector<KISTATUSBAR*> BACKGROUND_JOBS_MONITOR::m_statusBars
private

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