KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DESIGN_BLOCK_LIST Class Referenceabstract

Holds a list of DESIGN_BLOCK_INFO objects, along with a list of IO_ERRORs or PARSE_ERRORs that were thrown acquiring the DESIGN_BLOCK_INFOs. More...

#include <design_block_info.h>

Inheritance diagram for DESIGN_BLOCK_LIST:
DESIGN_BLOCK_LIST_IMPL

Public Types

typedef std::vector< std::unique_ptr< DESIGN_BLOCK_INFO > > DBILIST
 
typedef SYNC_QUEUE< std::unique_ptr< IO_ERROR > > ERRLIST
 

Public Member Functions

 DESIGN_BLOCK_LIST ()
 
virtual ~DESIGN_BLOCK_LIST ()
 
unsigned GetCount () const
 
const DBILISTGetList () const
 Was forced to add this by modview_frame.cpp.
 
void Clear ()
 
DESIGN_BLOCK_INFOGetDesignBlockInfo (const wxString &aDesignBlockName)
 Get info for a design block by id.
 
DESIGN_BLOCK_INFOGetDesignBlockInfo (const wxString &aLibNickname, const wxString &aDesignBlockName)
 Get info for a design block by libNickname/designBlockName.
 
DESIGN_BLOCK_INFOGetItem (unsigned aIdx) const
 Get info for a design block by index.
 
unsigned GetErrorCount () const
 
std::unique_ptr< IO_ERRORPopError ()
 
virtual bool ReadDesignBlockFiles (DESIGN_BLOCK_LIB_TABLE *aTable, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr)=0
 Read all the design blocks provided by the combination of aTable and aNickname.
 
DESIGN_BLOCK_LIB_TABLEGetTable () const
 

Protected Attributes

DESIGN_BLOCK_LIB_TABLEm_lib_table = nullptr
 no ownership
 
DBILIST m_list
 
ERRLIST m_errors
 some can be PARSE_ERRORs also
 

Detailed Description

Holds a list of DESIGN_BLOCK_INFO objects, along with a list of IO_ERRORs or PARSE_ERRORs that were thrown acquiring the DESIGN_BLOCK_INFOs.

This is a virtual class; its implementation lives in common/design_block_info_impl.cpp. To get instances of these classes, see DESIGN_BLOCK_LIST::GetInstance().

Definition at line 141 of file design_block_info.h.

Member Typedef Documentation

◆ DBILIST

typedef std::vector<std::unique_ptr<DESIGN_BLOCK_INFO> > DESIGN_BLOCK_LIST::DBILIST

Definition at line 144 of file design_block_info.h.

◆ ERRLIST

typedef SYNC_QUEUE<std::unique_ptr<IO_ERROR> > DESIGN_BLOCK_LIST::ERRLIST

Definition at line 145 of file design_block_info.h.

Constructor & Destructor Documentation

◆ DESIGN_BLOCK_LIST()

DESIGN_BLOCK_LIST::DESIGN_BLOCK_LIST ( )
inline

Definition at line 147 of file design_block_info.h.

◆ ~DESIGN_BLOCK_LIST()

virtual DESIGN_BLOCK_LIST::~DESIGN_BLOCK_LIST ( )
inlinevirtual

Definition at line 149 of file design_block_info.h.

Member Function Documentation

◆ Clear()

void DESIGN_BLOCK_LIST::Clear ( )
inline
Returns
Clears the design block info cache

Definition at line 162 of file design_block_info.h.

◆ GetCount()

unsigned DESIGN_BLOCK_LIST::GetCount ( ) const
inline
Returns
the number of items stored in list

Definition at line 154 of file design_block_info.h.

◆ GetDesignBlockInfo() [1/2]

DESIGN_BLOCK_INFO * DESIGN_BLOCK_LIST::GetDesignBlockInfo ( const wxString &  aDesignBlockName)

◆ GetDesignBlockInfo() [2/2]

DESIGN_BLOCK_INFO * DESIGN_BLOCK_LIST::GetDesignBlockInfo ( const wxString &  aLibNickname,
const wxString &  aDesignBlockName 
)

Get info for a design block by libNickname/designBlockName.

Definition at line 41 of file design_block_info.cpp.

References m_list.

◆ GetErrorCount()

unsigned DESIGN_BLOCK_LIST::GetErrorCount ( ) const
inline

Definition at line 183 of file design_block_info.h.

◆ GetItem()

DESIGN_BLOCK_INFO & DESIGN_BLOCK_LIST::GetItem ( unsigned  aIdx) const
inline

Get info for a design block by index.

Parameters
aIdxindex of the given item.
Returns
the aIdx item in list.

Definition at line 181 of file design_block_info.h.

◆ GetList()

const DBILIST & DESIGN_BLOCK_LIST::GetList ( ) const
inline

Was forced to add this by modview_frame.cpp.

Definition at line 157 of file design_block_info.h.

Referenced by DESIGN_BLOCK_TREE_MODEL_ADAPTER::getDesignBlocks().

◆ GetTable()

DESIGN_BLOCK_LIB_TABLE * DESIGN_BLOCK_LIST::GetTable ( ) const
inline

Definition at line 209 of file design_block_info.h.

Referenced by DESIGN_BLOCK_INFO_IMPL::load().

◆ PopError()

std::unique_ptr< IO_ERROR > DESIGN_BLOCK_LIST::PopError ( )
inline

Definition at line 185 of file design_block_info.h.

◆ ReadDesignBlockFiles()

virtual bool DESIGN_BLOCK_LIST::ReadDesignBlockFiles ( DESIGN_BLOCK_LIB_TABLE aTable,
const wxString *  aNickname = nullptr,
PROGRESS_REPORTER aProgressReporter = nullptr 
)
pure virtual

Read all the design blocks provided by the combination of aTable and aNickname.

Parameters
aTabledefines all the libraries.
aNicknameis the library to read from, or if NULL means read all design blocks from all known libraries in aTable.
aProgressReporteris an optional progress reporter. ReadDesignBlockFiles() will use 2 phases within the reporter.
Returns
true if it ran to completion, else false if it aborted after some number of errors. If true, it does not mean there were no errors, check GetErrorCount() for that, should be zero to indicate success.

Implemented in DESIGN_BLOCK_LIST_IMPL.

Member Data Documentation

◆ m_errors

ERRLIST DESIGN_BLOCK_LIST::m_errors
protected

some can be PARSE_ERRORs also

Definition at line 215 of file design_block_info.h.

Referenced by DESIGN_BLOCK_LIST_IMPL::CatchErrors(), and DESIGN_BLOCK_LIST_IMPL::ReadDesignBlockFiles().

◆ m_lib_table

DESIGN_BLOCK_LIB_TABLE* DESIGN_BLOCK_LIST::m_lib_table = nullptr
protected

◆ m_list

DBILIST DESIGN_BLOCK_LIST::m_list
protected

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