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 34 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 37 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.

Referenced by FOOTPRINT_LIST_IMPL::JoinWorkers().

39  {
40  m_owner = aOwner;
41  m_loaded = false;
42  m_nickname = aNickname;
43  m_fpname = aFootprintName;
44  m_num = 0;
45  m_pad_count = 0;
47 #if !USE_FPI_LAZY
48  load();
49 #endif
50  }
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 128 of file footprint_info.h.

129  {
130  if( !m_loaded )
131  load();
132  }
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 87 of file footprint_info.h.

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

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

Definition at line 93 of file footprint_info.h.

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

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

Definition at line 82 of file footprint_info.h.

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

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

Definition at line 111 of file footprint_info.h.

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

Definition at line 99 of file footprint_info.h.

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

Definition at line 105 of file footprint_info.h.

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

106  {
107  ensure_loaded();
108  return m_unique_pad_count;
109  }
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 78 of file footprint_info.cpp.

79 {
80  return aLibrary == m_nickname;
81 }
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 44 of file footprint_info_impl.cpp.

References DO_NOT_INCLUDE_NPTH, FOOTPRINT_LIST::GetTable(), FP_LIB_TABLE::LoadEnumeratedFootprint(), 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().

45 {
46  FP_LIB_TABLE* fptable = m_owner->GetTable();
47 
48  wxASSERT( fptable );
49 
50  std::unique_ptr<MODULE> footprint( fptable->LoadEnumeratedFootprint( m_nickname, m_fpname ) );
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 * LoadEnumeratedFootprint(const wxString &aNickname, const wxString &aFootprintName)
Function LoadEnumeratedFootprint.
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 146 of file footprint_info.h.

Referenced by load().

wxString FOOTPRINT_INFO::m_fpname
protectedinherited

Module name.

Definition at line 142 of file footprint_info.h.

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

wxString FOOTPRINT_INFO::m_keywords
protectedinherited

Footprint keywords.

Definition at line 147 of file footprint_info.h.

Referenced by load().

bool FOOTPRINT_INFO::m_loaded
protectedinherited

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

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

int FOOTPRINT_INFO::m_num
protectedinherited

Order number in the display list.

Definition at line 143 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 137 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 144 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 145 of file footprint_info.h.

Referenced by FOOTPRINT_INFO_IMPL(), and load().


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