KiCad PCB EDA Suite
Loading...
Searching...
No Matches
KICAD_DIFF::KICAD_MERGE_ENGINE Class Reference

Three-way merge plan generator. More...

#include <kicad_merge_engine.h>

Classes

struct  OPTIONS
 

Public Member Functions

 KICAD_MERGE_ENGINE ()=default
 
 KICAD_MERGE_ENGINE (const OPTIONS &aOptions)
 
const OPTIONSGetOptions () const
 
void SetOptions (const OPTIONS &aOptions)
 
MERGE_PLAN Plan (const DOCUMENT_DIFF &aAncestorOurs, const DOCUMENT_DIFF &aAncestorTheirs) const
 Plan the merge given the canonical pair of diffs.
 

Private Attributes

OPTIONS m_options
 

Detailed Description

Three-way merge plan generator.

The engine takes three pre-computed DOCUMENT_DIFFs. The pair of diffs (ancestor-vs-ours and ancestor-vs-theirs) is the canonical 3-way input. The third (ours-vs-theirs) is optional but lets the engine emit explicit collision records when both sides independently added the same KIID.

The engine does not parse files, does not touch I/O, and does not produce the merged document — those are the applier's job. This separation keeps plan generation trivially unit-testable and deterministic.

Definition at line 148 of file kicad_merge_engine.h.

Constructor & Destructor Documentation

◆ KICAD_MERGE_ENGINE() [1/2]

KICAD_DIFF::KICAD_MERGE_ENGINE::KICAD_MERGE_ENGINE ( )
default

◆ KICAD_MERGE_ENGINE() [2/2]

KICAD_DIFF::KICAD_MERGE_ENGINE::KICAD_MERGE_ENGINE ( const OPTIONS & aOptions)
inlineexplicit

Definition at line 163 of file kicad_merge_engine.h.

References m_options.

Member Function Documentation

◆ GetOptions()

const OPTIONS & KICAD_DIFF::KICAD_MERGE_ENGINE::GetOptions ( ) const
inline

Definition at line 165 of file kicad_merge_engine.h.

References m_options.

◆ Plan()

MERGE_PLAN KICAD_DIFF::KICAD_MERGE_ENGINE::Plan ( const DOCUMENT_DIFF & aAncestorOurs,
const DOCUMENT_DIFF & aAncestorTheirs ) const

Plan the merge given the canonical pair of diffs.

aAncestorOurs is the diff from ancestor to ours. aAncestorTheirs is the diff from ancestor to theirs.

Definition at line 301 of file kicad_merge_engine.cpp.

References _, KICAD_DIFF::MERGE_PLAN::actions, KICAD_DIFF::ADDED, KICAD_DIFF::ChangeInvalidatesZone(), KICAD_DIFF::ChangeRequiresConnectivityRebuild(), KICAD_DIFF::ITEM_CHANGE::children, KICAD_DIFF::COLLISION, KICAD_DIFF::DELETE_ITEM, KICAD_DIFF::DUPLICATE_UUID, KICAD_DIFF::ITEM_RESOLUTION::id, KICAD_DIFF::IndexChangesByKiid(), KICAD_DIFF::IndexPropertiesByName(), KICAD_DIFF::KEEP, KICAD_DIFF::ITEM_CHANGE::kind, KICAD_DIFF::ITEM_RESOLUTION::kind, KICAD_DIFF::PROPERTY_RESOLUTION::kind, m_options, KICAD_DIFF::MERGE_PROPS, KICAD_DIFF::MODIFIED, KICAD_DIFF::PROPERTY_RESOLUTION::name, name, KICAD_DIFF::ITEM_CHANGE::properties, KICAD_DIFF::ITEM_RESOLUTION::props, KICAD_DIFF::REMOVED, KICAD_DIFF::MERGE_PLAN::requiresConnectivityRebuild, KICAD_DIFF::MERGE_PLAN::requiresZoneRefill, KICAD_DIFF::ResolvePropertyConflict(), KICAD_DIFF::TAKE_OURS, KICAD_DIFF::TAKE_THEIRS, and KICAD_DIFF::MERGE_PLAN::unresolved.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), KIGIT_PCB_MERGE::Merge(), PCBNEW_JOBS_HANDLER::runFpLibMerge(), PCBNEW_JOBS_HANDLER::runPcbMerge(), EESCHEMA_JOBS_HANDLER::runSchMerge(), and EESCHEMA_JOBS_HANDLER::runSymLibMerge().

◆ SetOptions()

void KICAD_DIFF::KICAD_MERGE_ENGINE::SetOptions ( const OPTIONS & aOptions)
inline

Definition at line 166 of file kicad_merge_engine.h.

References m_options.

Member Data Documentation

◆ m_options

OPTIONS KICAD_DIFF::KICAD_MERGE_ENGINE::m_options
private

Definition at line 178 of file kicad_merge_engine.h.

Referenced by GetOptions(), KICAD_MERGE_ENGINE(), Plan(), and SetOptions().


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