KiCad PCB EDA Suite
footprint_info.cpp File Reference
#include <class_module.h>
#include <common.h>
#include <fctsys.h>
#include <footprint_info.h>
#include <fp_lib_table.h>
#include <html_messagebox.h>
#include <io_mgr.h>
#include <kiface_ids.h>
#include <kiway.h>
#include <lib_id.h>
#include <macros.h>
#include <pgm_base.h>
#include <thread>
#include <utility>
#include <wildcards_and_files_ext.h>

Go to the source code of this file.

Functions

static std::unique_ptr< FOOTPRINT_LISTget_instance_from_id (KIWAY &aKiway, int aId)
 

Function Documentation

static std::unique_ptr<FOOTPRINT_LIST> get_instance_from_id ( KIWAY aKiway,
int  aId 
)
static

Definition at line 112 of file footprint_info.cpp.

References KIWAY::FACE_PCB, KIFACE::IfaceOrAddress(), kiface, and KIWAY::KiFACE().

Referenced by FOOTPRINT_LIST::GetInstance().

113 {
114  void* ptr = nullptr;
115 
116  try
117  {
118  KIFACE* kiface = aKiway.KiFACE( KIWAY::FACE_PCB );
119 
120  if( !kiface )
121  return nullptr;
122 
123  ptr = kiface->IfaceOrAddress( aId );
124 
125  if( !ptr )
126  return nullptr;
127  }
128  catch( ... )
129  {
130  return nullptr;
131  }
132 
133  return std::unique_ptr<FOOTPRINT_LIST>( (FOOTPRINT_LIST*) ( ptr ) );
134 }
VTBL_ENTRY void * IfaceOrAddress(int aDataId)=0
Function IfaceOrAddress returns a pointer to the requested object.
pcbnew DSO
Definition: kiway.h:267
VTBL_ENTRY KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Function KiFACE returns the KIFACE* given a FACE_T.
Definition: kiway.cpp:148
Holds a list of FOOTPRINT_INFO objects, along with a list of IO_ERRORs or PARSE_ERRORs that were thro...
Class KIFACE is used by a participant in the KIWAY alchemy.
Definition: kiway.h:151
return & kiface
Definition: pcbnew.cpp:198