KiCad PCB EDA Suite
Loading...
Searching...
No Matches
ALLEGRO::BLOCK_REF< BLK_T > Class Template Reference

Non-owning, typed reference to a BLOCK in the database. More...

#include <allegro_db_utils.h>

Public Member Functions

 BLOCK_REF ()
 
 BLOCK_REF (const BLOCK_BASE *aBlock)
 
 operator bool () const
 True when this BLOCK_REF contains a non-null block pointer (i.e.
 
const BLK_T & operator* () const
 
const BLK_T * operator-> () const
 
const BLOCK_BASEBlock () const
 

Private Attributes

const BLOCK_BASEm_block
 

Detailed Description

template<ALLEGRO_BLOCK_DATA BLK_T>
class ALLEGRO::BLOCK_REF< BLK_T >

Non-owning, typed reference to a BLOCK in the database.

Wraps a raw BLOCK_BASE pointer and provides typed access to the block's data using std::optional-like operator-> and operator*.

Definition at line 88 of file allegro_db_utils.h.

Constructor & Destructor Documentation

◆ BLOCK_REF() [1/2]

template<ALLEGRO_BLOCK_DATA BLK_T>
ALLEGRO::BLOCK_REF< BLK_T >::BLOCK_REF ( )
inline

Definition at line 91 of file allegro_db_utils.h.

References m_block.

◆ BLOCK_REF() [2/2]

template<ALLEGRO_BLOCK_DATA BLK_T>
ALLEGRO::BLOCK_REF< BLK_T >::BLOCK_REF ( const BLOCK_BASE * aBlock)
inlineexplicit

Definition at line 96 of file allegro_db_utils.h.

References m_block.

Member Function Documentation

◆ Block()

template<ALLEGRO_BLOCK_DATA BLK_T>
const BLOCK_BASE * ALLEGRO::BLOCK_REF< BLK_T >::Block ( ) const
inline

Definition at line 119 of file allegro_db_utils.h.

References m_block.

◆ operator bool()

template<ALLEGRO_BLOCK_DATA BLK_T>
ALLEGRO::BLOCK_REF< BLK_T >::operator bool ( ) const
inlineexplicit

True when this BLOCK_REF contains a non-null block pointer (i.e.

the block resolved by its key).

Definition at line 105 of file allegro_db_utils.h.

References m_block.

◆ operator*()

template<ALLEGRO_BLOCK_DATA BLK_T>
const BLK_T & ALLEGRO::BLOCK_REF< BLK_T >::operator* ( ) const
inline

Definition at line 107 of file allegro_db_utils.h.

References ALLEGRO::BlockDataAs(), and m_block.

◆ operator->()

template<ALLEGRO_BLOCK_DATA BLK_T>
const BLK_T * ALLEGRO::BLOCK_REF< BLK_T >::operator-> ( ) const
inline

Definition at line 113 of file allegro_db_utils.h.

References ALLEGRO::BlockDataAs(), and m_block.

Member Data Documentation

◆ m_block

template<ALLEGRO_BLOCK_DATA BLK_T>
const BLOCK_BASE* ALLEGRO::BLOCK_REF< BLK_T >::m_block
private

Definition at line 122 of file allegro_db_utils.h.

Referenced by Block(), BLOCK_REF(), BLOCK_REF(), operator bool(), operator*(), and operator->().


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