KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KICAD_DIFF::LIB_MERGE_APPLIER< ITEM > Class Template Reference

Materialize a MERGE_PLAN into a merged name-keyed library. More...

#include <lib_merge_applier.h>

Classes

struct  REPORT
 

Public Types

using ITEM_MAP = std::map<wxString, const ITEM*>
 

Public Member Functions

 LIB_MERGE_APPLIER (const ITEM_MAP &aAncestor, const ITEM_MAP &aOurs, const ITEM_MAP &aTheirs, MERGE_PLAN aPlan)
 
std::vector< std::unique_ptr< ITEM > > Apply ()
 
const REPORTGetReport () const
 

Static Private Member Functions

static const ITEMfindItem (const ITEM_MAP &aMap, const wxString &aName)
 
static std::set< wxString > collectNames (const ITEM_MAP &aAncestor, const ITEM_MAP &aOurs, const ITEM_MAP &aTheirs)
 
static void takeFrom (const ITEM_MAP &aSource, const wxString &aName, std::map< wxString, const ITEM * > &aLive, std::size_t &aCounter)
 

Private Attributes

const ITEM_MAPm_ancestor
 
const ITEM_MAPm_ours
 
const ITEM_MAPm_theirs
 
MERGE_PLAN m_plan
 
REPORT m_report
 

Detailed Description

template<typename ITEM>
class KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >

Materialize a MERGE_PLAN into a merged name-keyed library.

Library identity is the canonical item name (LIB_SYMBOL or FOOTPRINT). Plan IDs come from LibraryItemKiidPath(name) on the differ side; the applier reconstructs the same KIID_PATH from each input map's keys and looks up matching resolutions.

Per-property merge (MERGE_PROPS) at the item level is not implemented; such resolutions are downgraded to TAKE_OURS and counted in mergePropsFallback so the job handler can surface them as unresolved to the user.

Definition at line 58 of file lib_merge_applier.h.

Member Typedef Documentation

◆ ITEM_MAP

template<typename ITEM>
using KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::ITEM_MAP = std::map<wxString, const ITEM*>

Definition at line 61 of file lib_merge_applier.h.

Constructor & Destructor Documentation

◆ LIB_MERGE_APPLIER()

template<typename ITEM>
KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::LIB_MERGE_APPLIER ( const ITEM_MAP & aAncestor,
const ITEM_MAP & aOurs,
const ITEM_MAP & aTheirs,
MERGE_PLAN aPlan )
inline

Definition at line 63 of file lib_merge_applier.h.

Member Function Documentation

◆ Apply()

◆ collectNames()

template<typename ITEM>
static std::set< wxString > KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::collectNames ( const ITEM_MAP & aAncestor,
const ITEM_MAP & aOurs,
const ITEM_MAP & aTheirs )
inlinestaticprivate

◆ findItem()

template<typename ITEM>
static const ITEM * KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::findItem ( const ITEM_MAP & aMap,
const wxString & aName )
inlinestaticprivate

◆ GetReport()

◆ takeFrom()

template<typename ITEM>
static void KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::takeFrom ( const ITEM_MAP & aSource,
const wxString & aName,
std::map< wxString, const ITEM * > & aLive,
std::size_t & aCounter )
inlinestaticprivate

Member Data Documentation

◆ m_ancestor

template<typename ITEM>
const ITEM_MAP& KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::m_ancestor
private

Definition at line 205 of file lib_merge_applier.h.

◆ m_ours

template<typename ITEM>
const ITEM_MAP& KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::m_ours
private

Definition at line 206 of file lib_merge_applier.h.

◆ m_plan

template<typename ITEM>
MERGE_PLAN KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::m_plan
private

Definition at line 208 of file lib_merge_applier.h.

◆ m_report

template<typename ITEM>
REPORT KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::m_report
private

Definition at line 209 of file lib_merge_applier.h.

◆ m_theirs

template<typename ITEM>
const ITEM_MAP& KICAD_DIFF::LIB_MERGE_APPLIER< ITEM >::m_theirs
private

Definition at line 207 of file lib_merge_applier.h.


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