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

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

Referenced by FOOTPRINT_LIST::GetInstance().

108 {
109  void* ptr = nullptr;
110 
111  try
112  {
113  KIFACE* kiface = aKiway.KiFACE( KIWAY::FACE_PCB );
114 
115  if( !kiface )
116  return nullptr;
117 
118  ptr = kiface->IfaceOrAddress( aId );
119 
120  if( !ptr )
121  return nullptr;
122  }
123  catch( ... )
124  {
125  return nullptr;
126  }
127 
128  return std::unique_ptr<FOOTPRINT_LIST>( (FOOTPRINT_LIST*) ( ptr ) );
129 }
VTBL_ENTRY void * IfaceOrAddress(int aDataId)=0
Function IfaceOrAddress returns a pointer to the requested object.
pcbnew DSO
Definition: kiway.h:266
VTBL_ENTRY KIFACE * KiFACE(FACE_T aFaceId, bool doLoad=true)
Function KiFACE returns the KIFACE* given a FACE_T.
Definition: kiway.cpp:150
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:150
return & kiface
Definition: pcbnew.cpp:207