KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DESIGN_BLOCK_LIST_IMPL Class Reference

#include <design_block_info_impl.h>

Inheritance diagram for DESIGN_BLOCK_LIST_IMPL:
DESIGN_BLOCK_LIST

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_IMPL ()
 
virtual ~DESIGN_BLOCK_LIST_IMPL ()
 
bool ReadDesignBlockFiles (DESIGN_BLOCK_LIB_TABLE *aTable, const wxString *aNickname=nullptr, PROGRESS_REPORTER *aProgressReporter=nullptr) override
 Read all the design blocks provided by the combination of aTable and aNickname.
 
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 ()
 
DESIGN_BLOCK_LIB_TABLEGetTable () const
 

Protected Member Functions

void loadLibs ()
 
void loadDesignBlocks ()
 

Protected Attributes

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

Private Member Functions

bool CatchErrors (const std::function< void()> &aFunc)
 Call aFunc, pushing any IO_ERRORs and std::exceptions it throws onto m_errors.
 

Private Attributes

SYNC_QUEUE< wxString > m_queue_in
 
SYNC_QUEUE< wxString > m_queue_out
 
long long m_list_timestamp
 
PROGRESS_REPORTERm_progress_reporter
 
std::atomic_bool m_cancelled
 
std::mutex m_join
 

Detailed Description

Definition at line 80 of file design_block_info_impl.h.

Member Typedef Documentation

◆ DBILIST

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

Definition at line 144 of file design_block_info.h.

◆ ERRLIST

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

Definition at line 145 of file design_block_info.h.

Constructor & Destructor Documentation

◆ DESIGN_BLOCK_LIST_IMPL()

DESIGN_BLOCK_LIST_IMPL::DESIGN_BLOCK_LIST_IMPL ( )

Definition at line 293 of file design_block_info_impl.cpp.

◆ ~DESIGN_BLOCK_LIST_IMPL()

virtual DESIGN_BLOCK_LIST_IMPL::~DESIGN_BLOCK_LIST_IMPL ( )
inlinevirtual

Definition at line 84 of file design_block_info_impl.h.

Member Function Documentation

◆ CatchErrors()

bool DESIGN_BLOCK_LIST_IMPL::CatchErrors ( const std::function< void()> &  aFunc)
private

Call aFunc, pushing any IO_ERRORs and std::exceptions it throws onto m_errors.

Returns
true if no error occurred.

Definition at line 59 of file design_block_info_impl.cpp.

References DESIGN_BLOCK_LIST::m_errors, SYNC_QUEUE< T >::move_push(), and THROW_IO_ERROR.

Referenced by loadDesignBlocks(), loadLibs(), and ReadDesignBlockFiles().

◆ Clear()

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

Definition at line 162 of file design_block_info.h.

◆ GetCount()

unsigned DESIGN_BLOCK_LIST::GetCount ( ) const
inlineinherited
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)
inherited

◆ GetDesignBlockInfo() [2/2]

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

Get info for a design block by libNickname/designBlockName.

Definition at line 41 of file design_block_info.cpp.

References DESIGN_BLOCK_LIST::m_list.

◆ GetErrorCount()

unsigned DESIGN_BLOCK_LIST::GetErrorCount ( ) const
inlineinherited

Definition at line 183 of file design_block_info.h.

◆ GetItem()

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

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
inlineinherited

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
inlineinherited

Definition at line 209 of file design_block_info.h.

Referenced by DESIGN_BLOCK_INFO_IMPL::load().

◆ loadDesignBlocks()

◆ loadLibs()

◆ PopError()

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

Definition at line 185 of file design_block_info.h.

◆ ReadDesignBlockFiles()

bool DESIGN_BLOCK_LIST_IMPL::ReadDesignBlockFiles ( DESIGN_BLOCK_LIB_TABLE aTable,
const wxString *  aNickname = nullptr,
PROGRESS_REPORTER aProgressReporter = nullptr 
)
overridevirtual

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.

Implements DESIGN_BLOCK_LIST.

Definition at line 90 of file design_block_info_impl.cpp.

References _, PROGRESS_REPORTER::AdvancePhase(), CatchErrors(), SYNC_QUEUE< T >::clear(), SYNC_QUEUE< T >::empty(), DESIGN_BLOCK_LIB_TABLE::GenerateTimestamp(), LIB_TABLE::GetLogicalLibs(), loadDesignBlocks(), loadLibs(), m_cancelled, DESIGN_BLOCK_LIST::m_errors, DESIGN_BLOCK_LIST::m_lib_table, DESIGN_BLOCK_LIST::m_list, m_list_timestamp, m_progress_reporter, m_queue_in, m_queue_out, SYNC_QUEUE< T >::push(), PROGRESS_REPORTER::Report(), PROGRESS_REPORTER::SetMaxProgress(), and SYNC_QUEUE< T >::size().

Referenced by PANEL_DESIGN_BLOCK_CHOOSER::PANEL_DESIGN_BLOCK_CHOOSER(), and PANEL_DESIGN_BLOCK_CHOOSER::RefreshLibs().

Member Data Documentation

◆ m_cancelled

std::atomic_bool DESIGN_BLOCK_LIST_IMPL::m_cancelled
private

Definition at line 105 of file design_block_info_impl.h.

Referenced by loadDesignBlocks(), loadLibs(), and ReadDesignBlockFiles().

◆ m_errors

ERRLIST DESIGN_BLOCK_LIST::m_errors
protectedinherited

some can be PARSE_ERRORs also

Definition at line 215 of file design_block_info.h.

Referenced by CatchErrors(), and ReadDesignBlockFiles().

◆ m_join

std::mutex DESIGN_BLOCK_LIST_IMPL::m_join
private

Definition at line 106 of file design_block_info_impl.h.

◆ m_lib_table

DESIGN_BLOCK_LIB_TABLE* DESIGN_BLOCK_LIST::m_lib_table = nullptr
protectedinherited

no ownership

Definition at line 212 of file design_block_info.h.

Referenced by loadDesignBlocks(), loadLibs(), and ReadDesignBlockFiles().

◆ m_list

DBILIST DESIGN_BLOCK_LIST::m_list
protectedinherited

◆ m_list_timestamp

long long DESIGN_BLOCK_LIST_IMPL::m_list_timestamp
private

Definition at line 103 of file design_block_info_impl.h.

Referenced by ReadDesignBlockFiles().

◆ m_progress_reporter

PROGRESS_REPORTER* DESIGN_BLOCK_LIST_IMPL::m_progress_reporter
private

Definition at line 104 of file design_block_info_impl.h.

Referenced by loadDesignBlocks(), loadLibs(), and ReadDesignBlockFiles().

◆ m_queue_in

SYNC_QUEUE<wxString> DESIGN_BLOCK_LIST_IMPL::m_queue_in
private

Definition at line 101 of file design_block_info_impl.h.

Referenced by loadLibs(), and ReadDesignBlockFiles().

◆ m_queue_out

SYNC_QUEUE<wxString> DESIGN_BLOCK_LIST_IMPL::m_queue_out
private

Definition at line 102 of file design_block_info_impl.h.

Referenced by loadDesignBlocks(), loadLibs(), and ReadDesignBlockFiles().


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