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 ()=default
 
unsigned GetCount () const
 
const std::vector< std::unique_ptr< FOOTPRINT_INFO > > & GetList () const
 
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.
 
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 152 of file footprint_info.h.

Constructor & Destructor Documentation

◆ FOOTPRINT_LIST()

FOOTPRINT_LIST::FOOTPRINT_LIST ( )
inline

Definition at line 155 of file footprint_info.h.

References m_adapter.

◆ ~FOOTPRINT_LIST()

virtual FOOTPRINT_LIST::~FOOTPRINT_LIST ( )
virtualdefault

Member Function Documentation

◆ Clear()

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

Implemented in FOOTPRINT_LIST_IMPL.

References GetFootprintInfo().

◆ GetAdapter()

FOOTPRINT_LIBRARY_ADAPTER * FOOTPRINT_LIST::GetAdapter ( ) const
inline

Definition at line 231 of file footprint_info.h.

References m_adapter.

◆ GetCount()

unsigned FOOTPRINT_LIST::GetCount ( ) const
inline

Definition at line 162 of file footprint_info.h.

References m_list.

◆ GetErrorCount()

unsigned FOOTPRINT_LIST::GetErrorCount ( ) const
inline

Definition at line 192 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 109 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 187 of file footprint_info.h.

References m_list.

◆ GetList()

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

Definition at line 164 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 197 of file footprint_info.h.

References m_errors.

Referenced by GetErrorMessages().

◆ PushError()

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

Definition at line 205 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 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 237 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: