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

Interface for resolving EDA_ITEM instances by the KIID from an RC_ITEM. More...

#include <rc_item.h>

Inheritance diagram for RC_ITEM_RESOLVER:
BOARD_RC_ITEM_RESOLVER SCH_RC_ITEM_RESOLVER

Public Member Functions

virtual ~RC_ITEM_RESOLVER ()=default
 
EDA_ITEM * ResolveItemById (const KIID &aKiid) const
 Resolve an item by its KIID.
 

Protected Member Functions

virtual EDA_ITEM * doResolveItemById (const KIID &aKiid) const =0
 The actual resolution logic for an item by its KIID, must be implemented against the actual item store of the inheriting class.
 

Private Attributes

std::unordered_set< KIID > m_resolutionMisses
 Store of missed resolution attempts (KIIDs that could not be resolved).
 

Detailed Description

Interface for resolving EDA_ITEM instances by the KIID from an RC_ITEM.

Implement this interface to provide a way to look up EDA_ITEM objects using their unique identifiers (KIID). For example, a PCB may defer to BOARD::ResolveItem().

These objects are expected to be short-lived and are not thread-safe for concurrent access.

Definition at line 86 of file rc_item.h.

Constructor & Destructor Documentation

◆ ~RC_ITEM_RESOLVER()

virtual RC_ITEM_RESOLVER::~RC_ITEM_RESOLVER ( )
virtualdefault

Member Function Documentation

◆ doResolveItemById()

virtual EDA_ITEM * RC_ITEM_RESOLVER::doResolveItemById ( const KIID & aKiid) const
protectedpure virtual

The actual resolution logic for an item by its KIID, must be implemented against the actual item store of the inheriting class.

Parameters
aKiidThe KIID of the item to resolve.
Returns
A pointer to the resolved item, or nullptr if not found. This pointer is borrowed and should not be deleted by the caller.

Implemented in BOARD_RC_ITEM_RESOLVER, and SCH_RC_ITEM_RESOLVER.

Referenced by ResolveItemById().

◆ ResolveItemById()

EDA_ITEM * RC_ITEM_RESOLVER::ResolveItemById ( const KIID & aKiid) const
inline

Resolve an item by its KIID.

Parameters
aKiidThe KIID of the item to resolve.
Returns
A pointer to the resolved item, or nullptr if not found. This pointer is borrowed and should not be deleted by the caller.

Definition at line 98 of file rc_item.h.

References doResolveItemById(), m_resolutionMisses, and niluuid.

Referenced by BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), RC_ITEM::GetJsonViolation(), and RC_ITEM::ShowReport().

Member Data Documentation

◆ m_resolutionMisses

std::unordered_set<KIID> RC_ITEM_RESOLVER::m_resolutionMisses
mutableprivate

Store of missed resolution attempts (KIIDs that could not be resolved).

Definition at line 128 of file rc_item.h.

Referenced by ResolveItemById().


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