|
KiCad PCB EDA Suite
|
#include <footprint_info_impl.h>
Public Member Functions | |
| FOOTPRINT_LIST_IMPL () | |
| virtual | ~FOOTPRINT_LIST_IMPL () |
| bool | ReadFootprintFiles (FOOTPRINT_LIBRARY_ADAPTER *aAdapter, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override |
| Read all the footprints provided by the combination of aTable and aNickname. | |
| void | Clear () override |
| void | WithFootprintsForLibrary (const wxString &aLibName, const std::function< void(const std::vector< LIB_TREE_ITEM * > &)> &aCallback) |
| Execute a callback with thread-safe access to the footprints for a library. | |
| unsigned | GetCount () const |
| const std::vector< std::unique_ptr< FOOTPRINT_INFO > > & | GetList () const |
| FOOTPRINT_INFO * | GetFootprintInfo (const wxString &aFootprintName) |
| Get info for a footprint by id. | |
| FOOTPRINT_INFO * | GetFootprintInfo (const wxString &aLibNickname, const wxString &aFootprintName) |
| Get info for a footprint by libNickname/footprintName. | |
| FOOTPRINT_INFO & | GetItem (unsigned aIdx) const |
| Get info for a footprint by index. | |
| unsigned | GetErrorCount () const |
| std::unique_ptr< IO_ERROR > | PopError () |
| void | PushError (std::unique_ptr< IO_ERROR > aError) |
| wxString | GetErrorMessages () |
| Returns all accumulated errors as a newline-separated string for display in the status bar. | |
| FOOTPRINT_LIBRARY_ADAPTER * | GetAdapter () const |
Protected Member Functions | |
| void | loadFootprints () |
Protected Attributes | |
| FOOTPRINT_LIBRARY_ADAPTER * | m_adapter |
| no ownership | |
| std::vector< std::unique_ptr< FOOTPRINT_INFO > > | m_list |
| SYNC_QUEUE< std::unique_ptr< IO_ERROR > > | m_errors |
| some can be PARSE_ERRORs also | |
Private Member Functions | |
| bool | CatchErrors (const std::function< void()> &aFunc) |
| Call aFunc, pushing any IO_ERRORs and std::exceptions it throws onto m_errors. | |
Private Attributes | |
| SYNC_QUEUE< wxString > | m_queue |
| long long | m_list_timestamp |
| PROGRESS_REPORTER * | m_progress_reporter |
| std::atomic_bool | m_cancelled |
| std::mutex | m_join |
| std::mutex | m_loadInProgress |
Definition at line 64 of file footprint_info_impl.h.
| FOOTPRINT_LIST_IMPL::FOOTPRINT_LIST_IMPL | ( | ) |
Definition at line 291 of file footprint_info_impl.cpp.
References m_cancelled, m_list_timestamp, and m_progress_reporter.
|
inlinevirtual |
Definition at line 68 of file footprint_info_impl.h.
|
private |
Call aFunc, pushing any IO_ERRORs and std::exceptions it throws onto m_errors.
Definition at line 111 of file footprint_info_impl.cpp.
References FOOTPRINT_LIST::m_errors, and THROW_IO_ERROR.
Referenced by loadFootprints(), and ReadFootprintFiles().
|
overridevirtual |
Implements FOOTPRINT_LIST.
Definition at line 69 of file footprint_info_impl.cpp.
References FOOTPRINT_LIST::m_list, m_list_timestamp, and m_loadInProgress.
|
inlineinherited |
Definition at line 232 of file footprint_info.h.
References m_adapter.
|
inlineinherited |
Definition at line 163 of file footprint_info.h.
References m_list.
|
inlineinherited |
Definition at line 193 of file footprint_info.h.
References m_errors.
|
inherited |
Returns all accumulated errors as a newline-separated string for display in the status bar.
This consumes the errors (pops them from the queue).
Definition at line 116 of file footprint_info.cpp.
References PopError().
Referenced by ReadFootprintFiles().
|
inherited |
Get info for a footprint by id.
Definition at line 49 of file footprint_info.cpp.
References GetFootprintInfo(), LIB_ID::GetLibItemName(), LIB_ID::GetLibNickname(), and LIB_ID::Parse().
Referenced by Clear(), GetFootprintInfo(), and DISPLAY_FOOTPRINTS_FRAME::InitDisplay().
|
inherited |
Get info for a footprint by libNickname/footprintName.
Definition at line 33 of file footprint_info.cpp.
References m_list.
|
inlineinherited |
Get info for a footprint by index.
| aIdx | index of the given item. |
Definition at line 188 of file footprint_info.h.
References m_list.
|
inlineinherited |
Definition at line 165 of file footprint_info.h.
References m_list.
Referenced by FOOTPRINT_LIST_IMPL::WithFootprintsForLibrary().
|
protected |
Definition at line 210 of file footprint_info_impl.cpp.
References CatchErrors(), GetKiCadThreadPool(), FOOTPRINT_LIST::m_adapter, m_cancelled, FOOTPRINT_LIST::m_list, m_progress_reporter, m_queue, SYNC_QUEUE< T >::move_push(), SYNC_QUEUE< T >::pop(), and tp.
Referenced by ReadFootprintFiles().
|
inlineinherited |
Definition at line 198 of file footprint_info.h.
References m_errors.
Referenced by GetErrorMessages().
|
inlineinherited |
Definition at line 206 of file footprint_info.h.
References m_errors.
|
overridevirtual |
Read all the footprints provided by the combination of aTable and aNickname.
| aAdapter | is used to access the libraries. |
| aNickname | is the library to read from, or if NULL means read all footprints from all known libraries in aTable. |
| aProgressReporter | is an optional progress reporter. ReadFootprintFiles() will use 2 phases within the reporter. |
Implements FOOTPRINT_LIST.
Definition at line 142 of file footprint_info_impl.cpp.
References _, CatchErrors(), FOOTPRINT_LIBRARY_ADAPTER::GenerateTimestamp(), LIBRARY_MANAGER_ADAPTER::GetLibraryNames(), loadFootprints(), FOOTPRINT_LIST::m_adapter, m_cancelled, FOOTPRINT_LIST::m_errors, FOOTPRINT_LIST::m_list, m_list_timestamp, m_loadInProgress, m_progress_reporter, and m_queue.
| void FOOTPRINT_LIST_IMPL::WithFootprintsForLibrary | ( | const wxString & | aLibName, |
| const std::function< void(const std::vector< LIB_TREE_ITEM * > &)> & | aCallback ) |
Execute a callback with thread-safe access to the footprints for a library.
The callback receives a vector of pointers to footprint info objects. These pointers are only valid for the duration of the callback. The internal mutex is held while the callback executes, preventing modification of the underlying list.
| aLibName | the library nickname to get footprints for |
| aCallback | function to call with the footprints vector |
Definition at line 78 of file footprint_info_impl.cpp.
References dummy, FOOTPRINT_LIST::GetList(), and m_loadInProgress.
|
protectedinherited |
no ownership
Definition at line 235 of file footprint_info.h.
Referenced by FOOTPRINT_LIST(), GetAdapter(), FOOTPRINT_LIST_IMPL::loadFootprints(), and FOOTPRINT_LIST_IMPL::ReadFootprintFiles().
|
private |
Definition at line 102 of file footprint_info_impl.h.
Referenced by FOOTPRINT_LIST_IMPL(), loadFootprints(), and ReadFootprintFiles().
|
protectedinherited |
some can be PARSE_ERRORs also
Definition at line 238 of file footprint_info.h.
Referenced by FOOTPRINT_LIST_IMPL::CatchErrors(), GetErrorCount(), PopError(), PushError(), and FOOTPRINT_LIST_IMPL::ReadFootprintFiles().
|
private |
Definition at line 103 of file footprint_info_impl.h.
|
protectedinherited |
Definition at line 237 of file footprint_info.h.
Referenced by FOOTPRINT_LIST_IMPL::Clear(), GetCount(), GetFootprintInfo(), GetItem(), GetList(), FOOTPRINT_LIST_IMPL::loadFootprints(), and FOOTPRINT_LIST_IMPL::ReadFootprintFiles().
|
private |
Definition at line 100 of file footprint_info_impl.h.
Referenced by Clear(), FOOTPRINT_LIST_IMPL(), and ReadFootprintFiles().
|
private |
Definition at line 104 of file footprint_info_impl.h.
Referenced by Clear(), ReadFootprintFiles(), and WithFootprintsForLibrary().
|
private |
Definition at line 101 of file footprint_info_impl.h.
Referenced by FOOTPRINT_LIST_IMPL(), loadFootprints(), and ReadFootprintFiles().
|
private |
Definition at line 99 of file footprint_info_impl.h.
Referenced by loadFootprints(), and ReadFootprintFiles().