KiCad PCB EDA Suite
Loading...
Searching...
No Matches
FOOTPRINT_LIST Class Referenceabstract

Holds a list of FOOTPRINT_INFO objects, along with a list of IO_ERRORs or PARSE_ERRORs that were thrown acquiring the FOOTPRINT_INFOs. More...

#include <footprint_info.h>

Inheritance diagram for FOOTPRINT_LIST:
FOOTPRINT_LIST_IMPL

Public Member Functions

 FOOTPRINT_LIST ()
 
virtual ~FOOTPRINT_LIST ()
 
unsigned GetCount () const
 
const std::vector< std::unique_ptr< FOOTPRINT_INFO > > & GetList () const
 Was forced to add this by modview_frame.cpp.
 
virtual void Clear ()=0
 
FOOTPRINT_INFOGetFootprintInfo (const wxString &aFootprintName)
 Get info for a footprint by id.
 
FOOTPRINT_INFOGetFootprintInfo (const wxString &aLibNickname, const wxString &aFootprintName)
 Get info for a footprint by libNickname/footprintName.
 
FOOTPRINT_INFOGetItem (unsigned aIdx) const
 Get info for a footprint by index.
 
unsigned GetErrorCount () const
 
std::unique_ptr< IO_ERRORPopError ()
 
void PushError (std::unique_ptr< IO_ERROR > aError)
 
virtual bool ReadFootprintFiles (FOOTPRINT_LIBRARY_ADAPTER *aAdapter, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)=0
 Read all the footprints provided by the combination of aTable and aNickname.
 
void DisplayErrors (wxTopLevelWindow *aCaller=nullptr)
 
wxString GetErrorMessages ()
 Returns all accumulated errors as a newline-separated string for display in the status bar.
 
FOOTPRINT_LIBRARY_ADAPTERGetAdapter () const
 

Protected Attributes

FOOTPRINT_LIBRARY_ADAPTERm_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
 

Detailed Description

Holds a list of FOOTPRINT_INFO objects, along with a list of IO_ERRORs or PARSE_ERRORs that were thrown acquiring the FOOTPRINT_INFOs.

This is a virtual class; its implementation lives in pcbnew/footprint_info_impl.cpp. To get instances of these classes, see FOOTPRINT_LIST::GetInstance().

Definition at line 160 of file footprint_info.h.

Constructor & Destructor Documentation

◆ FOOTPRINT_LIST()

FOOTPRINT_LIST::FOOTPRINT_LIST ( )
inline

Definition at line 163 of file footprint_info.h.

References m_adapter.

◆ ~FOOTPRINT_LIST()

virtual FOOTPRINT_LIST::~FOOTPRINT_LIST ( )
inlinevirtual

Definition at line 168 of file footprint_info.h.

Member Function Documentation

◆ Clear()

virtual void FOOTPRINT_LIST::Clear ( )
pure virtual
Returns
Clears the footprint info cache

Implemented in FOOTPRINT_LIST_IMPL.

References GetFootprintInfo().

◆ DisplayErrors()

void FOOTPRINT_LIST::DisplayErrors ( wxTopLevelWindow * aCaller = nullptr)

◆ GetAdapter()

FOOTPRINT_LIBRARY_ADAPTER * FOOTPRINT_LIST::GetAdapter ( ) const
inline

Definition at line 254 of file footprint_info.h.

References m_adapter.

◆ GetCount()

unsigned FOOTPRINT_LIST::GetCount ( ) const
inline
Returns
the number of items stored in list

Definition at line 175 of file footprint_info.h.

References m_list.

◆ GetErrorCount()

unsigned FOOTPRINT_LIST::GetErrorCount ( ) const
inline

Definition at line 213 of file footprint_info.h.

References m_errors.

◆ GetErrorMessages()

wxString FOOTPRINT_LIST::GetErrorMessages ( )

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 136 of file footprint_info.cpp.

References PopError().

Referenced by ReadFootprintFiles().

◆ GetFootprintInfo() [1/2]

FOOTPRINT_INFO * FOOTPRINT_LIST::GetFootprintInfo ( const wxString & aFootprintName)

Get info for a footprint by id.

Definition at line 53 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().

◆ GetFootprintInfo() [2/2]

FOOTPRINT_INFO * FOOTPRINT_LIST::GetFootprintInfo ( const wxString & aLibNickname,
const wxString & aFootprintName )

Get info for a footprint by libNickname/footprintName.

Definition at line 37 of file footprint_info.cpp.

References m_list.

◆ GetItem()

FOOTPRINT_INFO & FOOTPRINT_LIST::GetItem ( unsigned aIdx) const
inline

Get info for a footprint by index.

Parameters
aIdxindex of the given item.
Returns
the aIdx item in list.

Definition at line 208 of file footprint_info.h.

References m_list.

◆ GetList()

const std::vector< std::unique_ptr< FOOTPRINT_INFO > > & FOOTPRINT_LIST::GetList ( ) const
inline

Was forced to add this by modview_frame.cpp.

Definition at line 181 of file footprint_info.h.

References m_list.

Referenced by FOOTPRINT_LIST_IMPL::WithFootprintsForLibrary().

◆ PopError()

std::unique_ptr< IO_ERROR > FOOTPRINT_LIST::PopError ( )
inline

Definition at line 218 of file footprint_info.h.

References m_errors.

Referenced by DisplayErrors(), and GetErrorMessages().

◆ PushError()

void FOOTPRINT_LIST::PushError ( std::unique_ptr< IO_ERROR > aError)
inline

Definition at line 226 of file footprint_info.h.

References m_errors.

◆ ReadFootprintFiles()

virtual bool FOOTPRINT_LIST::ReadFootprintFiles ( FOOTPRINT_LIBRARY_ADAPTER * aAdapter,
const wxString * aNickname = nullptr,
PROGRESS_REPORTER * aProgressReporter = nullptr )
pure virtual

Read all the footprints provided by the combination of aTable and aNickname.

Parameters
aAdapteris used to access the libraries.
aNicknameis the library to read from, or if NULL means read all footprints from all known libraries in aTable.
aProgressReporteris an optional progress reporter. ReadFootprintFiles() will use 2 phases within the reporter.
Returns
true if it ran to completion, else false if it aborted after some number of errors. If true, it does not mean there were no errors, check GetErrorCount() for that, should be zero to indicate success.

Implemented in FOOTPRINT_LIST_IMPL.

References DisplayErrors(), and GetErrorMessages().

Member Data Documentation

◆ m_adapter

FOOTPRINT_LIBRARY_ADAPTER* FOOTPRINT_LIST::m_adapter
protected

◆ m_errors

SYNC_QUEUE<std::unique_ptr<IO_ERROR> > FOOTPRINT_LIST::m_errors
protected

some can be PARSE_ERRORs also

Definition at line 260 of file footprint_info.h.

Referenced by FOOTPRINT_LIST_IMPL::CatchErrors(), GetErrorCount(), PopError(), PushError(), and FOOTPRINT_LIST_IMPL::ReadFootprintFiles().

◆ m_list

std::vector<std::unique_ptr<FOOTPRINT_INFO> > FOOTPRINT_LIST::m_list
protected

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