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

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

Referenced by FOOTPRINT_LIST::GetInstance().

112 {
113  void* ptr = nullptr;
114 
115  try
116  {
117  KIFACE* kiface = aKiway.KiFACE( KIWAY::FACE_PCB );
118 
119  if( !kiface )
120  return nullptr;
121 
122  ptr = kiface->IfaceOrAddress( aId );
123 
124  if( !ptr )
125  return nullptr;
126  }
127  catch( ... )
128  {
129  return nullptr;
130  }
131 
132  return std::unique_ptr<FOOTPRINT_LIST>( (FOOTPRINT_LIST*) ( ptr ) );
133 }
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