|
KiCad PCB EDA Suite
|
#include <background_jobs_monitor.h>
Public Member Functions | |
| BACKGROUND_JOBS_MONITOR () | |
| std::shared_ptr< BACKGROUND_JOB > | Create (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 | onListWindowDestroyed (wxWindowDestroyEvent &aEvent) |
| Handles a list window that its parent destroys without a close event. | |
| void | removeShownDialog (wxObject *aWindow) |
| Removes a list window from m_shownDialogs. | |
| 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 m_jobs, m_shownDialogs and m_statusBars. | |
Friends | |
| class | BACKGROUND_JOB_REPORTER |
| class | BACKGROUND_JOB_LIST |
Definition at line 104 of file background_jobs_monitor.h.
| BACKGROUND_JOBS_MONITOR::BACKGROUND_JOBS_MONITOR | ( | ) |
Definition at line 220 of file background_jobs_monitor.cpp.
Referenced by BACKGROUND_JOB_LIST.
| std::shared_ptr< BACKGROUND_JOB > BACKGROUND_JOBS_MONITOR::Create | ( | const wxString & | aName | ) |
Creates a background job with the given name.
| aName | is the displayed title for the event |
Definition at line 226 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(), PGM_BASE::PreloadDesignBlockLibraries(), PCB::IFACE::PreloadLibraries(), SCH::IFACE::PreloadLibraries(), and PLUGIN_CONTENT_MANAGER::RunBackgroundUpdate().
|
private |
Handles job status updates, intended to be called by BACKGROUND_JOB_REPORTER only.
Definition at line 346 of file background_jobs_monitor.cpp.
References BACKGROUND_JOB_LIST, m_jobs, m_mutex, m_shownDialogs, and m_statusBars.
Referenced by BACKGROUND_JOB_LIST, RegisterStatusBar(), and Remove().
|
private |
Handles removing the shown list window from our list of shown windows.
Definition at line 292 of file background_jobs_monitor.cpp.
References removeShownDialog().
Referenced by BACKGROUND_JOB_LIST, and ShowList().
|
private |
Handles a list window that its parent destroys without a close event.
Definition at line 300 of file background_jobs_monitor.cpp.
References removeShownDialog().
Referenced by BACKGROUND_JOB_LIST, and ShowList().
| void BACKGROUND_JOBS_MONITOR::RegisterStatusBar | ( | KISTATUSBAR * | aStatusBar | ) |
Add a status bar for handling.
Definition at line 380 of file background_jobs_monitor.cpp.
References jobUpdated(), m_jobs, m_mutex, and m_statusBars.
Referenced by BACKGROUND_JOB_LIST, EVT_MENU(), PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME(), and SCH_BASE_FRAME::SCH_BASE_FRAME().
| 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 250 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(), PGM_BASE::PreloadDesignBlockLibraries(), PCB::IFACE::PreloadLibraries(), SCH::IFACE::PreloadLibraries(), and UPDATE_CANCELLER::~UPDATE_CANCELLER().
|
private |
Removes a list window from m_shownDialogs.
| aWindow | can be partly destroyed so only its address is used |
Definition at line 308 of file background_jobs_monitor.cpp.
References BACKGROUND_JOB_LIST, m_mutex, and m_shownDialogs.
Referenced by BACKGROUND_JOB_LIST, onListWindowClosed(), and onListWindowDestroyed().
| void BACKGROUND_JOBS_MONITOR::ShowList | ( | wxWindow * | aParent, |
| wxPoint | aPos ) |
Shows the background job list.
Definition at line 322 of file background_jobs_monitor.cpp.
References BACKGROUND_JOB_LIST, m_jobs, m_mutex, m_shownDialogs, onListWindowClosed(), and onListWindowDestroyed().
Referenced by BACKGROUND_JOB_LIST, and KISTATUSBAR::onBackgroundProgressClick().
| void BACKGROUND_JOBS_MONITOR::UnregisterStatusBar | ( | KISTATUSBAR * | aStatusBar | ) |
Removes status bar from handling.
Definition at line 399 of file background_jobs_monitor.cpp.
References m_mutex, and m_statusBars.
Referenced by BACKGROUND_JOB_LIST, KICAD_MANAGER_FRAME::~KICAD_MANAGER_FRAME(), PCB_BASE_EDIT_FRAME::~PCB_BASE_EDIT_FRAME(), and SCH_BASE_FRAME::~SCH_BASE_FRAME().
|
friend |
Definition at line 107 of file background_jobs_monitor.h.
References BACKGROUND_JOB_LIST, BACKGROUND_JOBS_MONITOR(), Create(), jobUpdated(), onListWindowClosed(), onListWindowDestroyed(), RegisterStatusBar(), Remove(), removeShownDialog(), ShowList(), and UnregisterStatusBar().
Referenced by BACKGROUND_JOB_LIST, Create(), jobUpdated(), Remove(), removeShownDialog(), and ShowList().
|
friend |
Definition at line 106 of file background_jobs_monitor.h.
References BACKGROUND_JOB_REPORTER.
Referenced by BACKGROUND_JOB_REPORTER.
|
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 167 of file background_jobs_monitor.h.
Referenced by Create(), jobUpdated(), RegisterStatusBar(), Remove(), and ShowList().
|
mutableprivate |
Mutex to protect access to m_jobs, m_shownDialogs and m_statusBars.
Definition at line 173 of file background_jobs_monitor.h.
Referenced by Create(), jobUpdated(), RegisterStatusBar(), Remove(), removeShownDialog(), ShowList(), and UnregisterStatusBar().
|
private |
Definition at line 168 of file background_jobs_monitor.h.
Referenced by Create(), jobUpdated(), Remove(), removeShownDialog(), and ShowList().
|
private |
Definition at line 170 of file background_jobs_monitor.h.
Referenced by jobUpdated(), RegisterStatusBar(), Remove(), and UnregisterStatusBar().