KiCad PCB EDA Suite
FOOTPRINT_INFO_IMPL Class Reference

#include <footprint_info_impl.h>

Inheritance diagram for FOOTPRINT_INFO_IMPL:
FOOTPRINT_INFO

Public Member Functions

 FOOTPRINT_INFO_IMPL (FOOTPRINT_LIST *aOwner, const wxString &aNickname, const wxString &aFootprintName)
 
const wxString & GetFootprintName () const
 
const wxString & GetNickname () const
 
const wxString & GetDoc ()
 
const wxString & GetKeywords ()
 
unsigned GetPadCount ()
 
unsigned GetUniquePadCount ()
 
int GetOrderNum ()
 
bool InLibrary (const wxString &aLibrary) const
 Test if the FOOTPRINT_INFO object was loaded from aLibrary. More...
 

Protected Member Functions

virtual void load () override
 lazily load stuff not filled in by constructor. This may throw IO_ERRORS. More...
 
void ensure_loaded ()
 

Protected Attributes

FOOTPRINT_LISTm_owner
 provides access to FP_LIB_TABLE More...
 
bool m_loaded
 
wxString m_nickname
 library as known in FP_LIB_TABLE More...
 
wxString m_fpname
 Module name. More...
 
int m_num
 Order number in the display list. More...
 
int m_pad_count
 Number of pads. More...
 
int m_unique_pad_count
 Number of unique pads. More...
 
wxString m_doc
 Footprint description. More...
 
wxString m_keywords
 Footprint keywords. More...
 

Detailed Description

Definition at line 35 of file footprint_info_impl.h.

Constructor & Destructor Documentation

FOOTPRINT_INFO_IMPL::FOOTPRINT_INFO_IMPL ( FOOTPRINT_LIST aOwner,
const wxString &  aNickname,
const wxString &  aFootprintName 
)
inline

Definition at line 38 of file footprint_info_impl.h.

References load(), FOOTPRINT_INFO::m_fpname, FOOTPRINT_INFO::m_loaded, FOOTPRINT_INFO::m_nickname, FOOTPRINT_INFO::m_num, FOOTPRINT_INFO::m_owner, FOOTPRINT_INFO::m_pad_count, and FOOTPRINT_INFO::m_unique_pad_count.

40  {
41  m_owner = aOwner;
42  m_loaded = false;
43  m_nickname = aNickname;
44  m_fpname = aFootprintName;
45  m_num = 0;
46  m_pad_count = 0;
48 #if !USE_FPI_LAZY
49  load();
50 #endif
51  }
int m_unique_pad_count
Number of unique pads.
int m_num
Order number in the display list.
FOOTPRINT_LIST * m_owner
provides access to FP_LIB_TABLE
wxString m_fpname
Module name.
int m_pad_count
Number of pads.
wxString m_nickname
library as known in FP_LIB_TABLE
virtual void load() override
lazily load stuff not filled in by constructor. This may throw IO_ERRORS.

Member Function Documentation

void FOOTPRINT_INFO::ensure_loaded ( )
inlineprotectedinherited

Definition at line 127 of file footprint_info.h.

128  {
129  if( !m_loaded )
130  load();
131  }
virtual void load()=0
lazily load stuff not filled in by constructor. This may throw IO_ERRORS.
const wxString& FOOTPRINT_INFO::GetDoc ( )
inlineinherited

Definition at line 86 of file footprint_info.h.

Referenced by DisplayCmpDoc(), and CVPCB_MAINFRAME::DisplayStatus().

87  {
88  ensure_loaded();
89  return m_doc;
90  }
wxString m_doc
Footprint description.
const wxString& FOOTPRINT_INFO::GetFootprintName ( ) const
inlineinherited
const wxString& FOOTPRINT_INFO::GetKeywords ( )
inlineinherited

Definition at line 92 of file footprint_info.h.

Referenced by DisplayCmpDoc(), CVPCB_MAINFRAME::DisplayStatus(), and PCB_BASE_FRAME::SelectFootprint().

93  {
94  ensure_loaded();
95  return m_keywords;
96  }
wxString m_keywords
Footprint keywords.
const wxString& FOOTPRINT_INFO::GetNickname ( ) const
inlineinherited

Definition at line 81 of file footprint_info.h.

Referenced by FOOTPRINT_FILTER::ITERATOR::FootprintFilterMatch(), DISPLAY_FOOTPRINTS_FRAME::InitDisplay(), and PCB_BASE_FRAME::SelectFootprint().

82  {
83  return m_nickname;
84  }
wxString m_nickname
library as known in FP_LIB_TABLE
int FOOTPRINT_INFO::GetOrderNum ( )
inlineinherited

Definition at line 110 of file footprint_info.h.

111  {
112  ensure_loaded();
113  return m_num;
114  }
int m_num
Order number in the display list.
unsigned FOOTPRINT_INFO::GetPadCount ( )
inlineinherited

Definition at line 98 of file footprint_info.h.

99  {
100  ensure_loaded();
101  return m_pad_count;
102  }
int m_pad_count
Number of pads.
unsigned FOOTPRINT_INFO::GetUniquePadCount ( )
inlineinherited

Definition at line 104 of file footprint_info.h.

Referenced by FOOTPRINT_FILTER::ITERATOR::PinCountMatch().

105  {
106  ensure_loaded();
107  return m_unique_pad_count;
108  }
int m_unique_pad_count
Number of unique pads.
bool FOOTPRINT_INFO::InLibrary ( const wxString &  aLibrary) const
inherited

Test if the FOOTPRINT_INFO object was loaded from aLibrary.

Parameters
aLibraryis the nickname of the library to test.
Returns
true if the FOOTPRINT_INFO object was loaded from aLibrary. Otherwise false.

Definition at line 77 of file footprint_info.cpp.

References FOOTPRINT_INFO::m_nickname.

78 {
79  return aLibrary == m_nickname;
80 }
wxString m_nickname
library as known in FP_LIB_TABLE
void FOOTPRINT_INFO_IMPL::load ( )
overrideprotectedvirtual

lazily load stuff not filled in by constructor. This may throw IO_ERRORS.

Implements FOOTPRINT_INFO.

Definition at line 43 of file footprint_info_impl.cpp.

References DO_NOT_INCLUDE_NPTH, FP_LIB_TABLE::FootprintLoad(), FOOTPRINT_LIST::GetTable(), FOOTPRINT_INFO::m_doc, FOOTPRINT_INFO::m_fpname, FOOTPRINT_INFO::m_keywords, FOOTPRINT_INFO::m_loaded, FOOTPRINT_INFO::m_nickname, FOOTPRINT_INFO::m_owner, FOOTPRINT_INFO::m_pad_count, and FOOTPRINT_INFO::m_unique_pad_count.

Referenced by FOOTPRINT_INFO_IMPL().

44 {
45  FP_LIB_TABLE* fptable = m_owner->GetTable();
46 
47  wxASSERT( fptable );
48 
49  std::unique_ptr<MODULE> footprint( fptable->FootprintLoad( m_nickname, m_fpname ) );
50 
51  if( footprint.get() == NULL ) // Should happen only with malformed/broken libraries
52  {
53  m_pad_count = 0;
55  }
56  else
57  {
58  m_pad_count = footprint->GetPadCount( DO_NOT_INCLUDE_NPTH );
59  m_unique_pad_count = footprint->GetUniquePadCount( DO_NOT_INCLUDE_NPTH );
60  m_keywords = footprint->GetKeywords();
61  m_doc = footprint->GetDescription();
62 
63  // tell ensure_loaded() I'm loaded.
64  m_loaded = true;
65  }
66 }
MODULE * FootprintLoad(const wxString &aNickname, const wxString &aFootprintName)
Function FootprintLoad.
int m_unique_pad_count
Number of unique pads.
FOOTPRINT_LIST * m_owner
provides access to FP_LIB_TABLE
wxString m_doc
Footprint description.
wxString m_fpname
Module name.
wxString m_keywords
Footprint keywords.
int m_pad_count
Number of pads.
wxString m_nickname
library as known in FP_LIB_TABLE
FP_LIB_TABLE * GetTable() const

Member Data Documentation

wxString FOOTPRINT_INFO::m_doc
protectedinherited

Footprint description.

Definition at line 145 of file footprint_info.h.

Referenced by load().

wxString FOOTPRINT_INFO::m_fpname
protectedinherited

Module name.

Definition at line 141 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL(), load(), and operator<().

wxString FOOTPRINT_INFO::m_keywords
protectedinherited

Footprint keywords.

Definition at line 146 of file footprint_info.h.

Referenced by load().

bool FOOTPRINT_INFO::m_loaded
protectedinherited

Definition at line 138 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL(), and load().

wxString FOOTPRINT_INFO::m_nickname
protectedinherited

library as known in FP_LIB_TABLE

Definition at line 140 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL(), FOOTPRINT_INFO::InLibrary(), load(), and operator<().

int FOOTPRINT_INFO::m_num
protectedinherited

Order number in the display list.

Definition at line 142 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL().

FOOTPRINT_LIST* FOOTPRINT_INFO::m_owner
protectedinherited

provides access to FP_LIB_TABLE

Definition at line 136 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL(), and load().

int FOOTPRINT_INFO::m_pad_count
protectedinherited

Number of pads.

Definition at line 143 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL(), and load().

int FOOTPRINT_INFO::m_unique_pad_count
protectedinherited

Number of unique pads.

Definition at line 144 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL(), and load().


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