KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ALLEGRO::LL_WALKER Class Reference

Range-for-compatible walker over a linked list of BLOCK_BASE objects in a BRD_DB. More...

#include <allegro_db_utils.h>

Classes

class  ITERATOR
 

Public Types

using NEXT_FUNC_T = std::function<uint32_t( const BLOCK_BASE& )>
 

Public Member Functions

 LL_WALKER (uint32_t aHead, uint32_t aTail, const BRD_DB &aBoard, NEXT_FUNC_T aNextFunc=GetPrimaryNext)
 General constructor for walking any linked list given head/tail keys, a database, and a next-function that returns the next key for a given block.
 
 LL_WALKER (const FILE_HEADER::LINKED_LIST &aList, const BRD_DB &aBoard, NEXT_FUNC_T aNextFunc=GetPrimaryNext)
 Convenience constructor for linked lists in the file header.
 
ITERATOR begin () const
 
ITERATOR end () const
 

Private Attributes

uint32_t m_head
 
uint32_t m_tail
 
const BRD_DBm_board
 
NEXT_FUNC_T m_nextFunction
 

Detailed Description

Range-for-compatible walker over a linked list of BLOCK_BASE objects in a BRD_DB.

By default, follows the primary linked-list pointer for each block type (via GetPrimaryNext). A custom next-function can be provided via SetNextFunc() for lists that use a different link field (e.g. m_NextInFp for pad lists).

Definition at line 144 of file allegro_db_utils.h.

Member Typedef Documentation

◆ NEXT_FUNC_T

using ALLEGRO::LL_WALKER::NEXT_FUNC_T = std::function<uint32_t( const BLOCK_BASE& )>

Definition at line 147 of file allegro_db_utils.h.

Constructor & Destructor Documentation

◆ LL_WALKER() [1/2]

ALLEGRO::LL_WALKER::LL_WALKER ( uint32_t aHead,
uint32_t aTail,
const BRD_DB & aBoard,
NEXT_FUNC_T aNextFunc = GetPrimaryNext )
inline

General constructor for walking any linked list given head/tail keys, a database, and a next-function that returns the next key for a given block.

Parameters
aHeadkey of the first block in the list
aTailkey of the last block in the list (the list ends when the next key is this value)
aBoardthe database to look up blocks in
aNextFuncfunction that takes some block and returns the key of the next block

Definition at line 240 of file allegro_db_utils.h.

References ALLEGRO::GetPrimaryNext(), m_board, m_head, m_nextFunction, m_tail, and move.

Referenced by LL_WALKER().

◆ LL_WALKER() [2/2]

ALLEGRO::LL_WALKER::LL_WALKER ( const FILE_HEADER::LINKED_LIST & aList,
const BRD_DB & aBoard,
NEXT_FUNC_T aNextFunc = GetPrimaryNext )
inline

Convenience constructor for linked lists in the file header.

Definition at line 252 of file allegro_db_utils.h.

References ALLEGRO::GetPrimaryNext(), LL_WALKER(), and move.

Member Function Documentation

◆ begin()

ITERATOR ALLEGRO::LL_WALKER::begin ( ) const
inline

Definition at line 258 of file allegro_db_utils.h.

References m_board, m_head, m_nextFunction, and m_tail.

◆ end()

ITERATOR ALLEGRO::LL_WALKER::end ( ) const
inline

Definition at line 263 of file allegro_db_utils.h.

Member Data Documentation

◆ m_board

const BRD_DB& ALLEGRO::LL_WALKER::m_board
private

Definition at line 271 of file allegro_db_utils.h.

Referenced by begin(), and LL_WALKER().

◆ m_head

uint32_t ALLEGRO::LL_WALKER::m_head
private

Definition at line 269 of file allegro_db_utils.h.

Referenced by begin(), and LL_WALKER().

◆ m_nextFunction

NEXT_FUNC_T ALLEGRO::LL_WALKER::m_nextFunction
private

Definition at line 272 of file allegro_db_utils.h.

Referenced by begin(), and LL_WALKER().

◆ m_tail

uint32_t ALLEGRO::LL_WALKER::m_tail
private

Definition at line 270 of file allegro_db_utils.h.

Referenced by begin(), and LL_WALKER().


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