|
KiCad PCB EDA Suite
|
Main-thread extraction cache. More...
#include <conn_inputs.h>
Classes | |
| struct | INSTANCE_INPUT |
| struct | ISLAND_LESS |
Public Types | |
| using | SOURCE_KEY = std::pair<SCREEN_ID, KIID> |
| using | SCREEN_CACHE = CACHE_TABLE<SCREEN_ID, SCREEN_FACTS> |
| using | FACT_CACHE = CACHE_TABLE<SOURCE_KEY, ITEM_FACT> |
| using | INSTANCE_CACHE = CACHE_TABLE<INST_ID, INSTANCE_FACTS> |
| using | TEXT_CACHE = CACHE_TABLE<ITEM_KEY, ITEM_TEXT_FACT, KEY_LESS> |
| using | AREA_CACHE = CACHE_TABLE<ITEM_KEY, INSTANCE_RULE_AREA_FACT, KEY_LESS> |
| using | UNIT_SIGNATURE = std::vector<std::pair<KIID, int>> |
| using | ISLAND_KEY = std::pair<SCREEN_ID, UNIT_SIGNATURE> |
| using | UNIT_VIEW = std::span<const std::pair<KIID, int>> |
| using | ISLAND_LOOKUP = std::pair<SCREEN_ID, UNIT_VIEW> |
| using | GEOMETRY_CACHE = CACHE_TABLE<SCREEN_ID, SCREEN_GEOMETRY> |
| using | ISLAND_CACHE = CACHE_TABLE<ISLAND_KEY, SCREEN_ISLANDS, ISLAND_LESS> |
Public Member Functions | |
| INPUT_STORE (CACHE_VERSIONS &aVersions, SESSION_KEYS &aKeys) | |
| std::vector< FRAME_INSTANCE > | Capture (const SCH_SHEET_LIST &aPaths, uint64_t aTextEpoch) |
| bool | ExternalSourcesChanged (const SCH_SHEET_LIST &aPaths, bool aContextUnchanged=false) const |
| Compare retained external inputs for current instance/screen pairs, excluding model/revision changes. | |
| const SCREEN_CACHE::ENTRY & | Screen (const SCH_SCREEN &aScreen) |
| const INSTANCE_CACHE::ENTRY & | Instance (const SCH_SCREEN &aScreen, const SCH_SHEET_PATH &aPath, uint64_t aTextEpoch) |
| const FACT_CACHE::ENTRY * | Fact (const SOURCE_KEY &aKey) const |
| const TEXT_CACHE::ENTRY * | Text (const ITEM_KEY &aKey) const |
| const AREA_CACHE::ENTRY * | Area (const ITEM_KEY &aKey) const |
| const SCREEN_CACHE::ENTRY * | FindScreen (SCREEN_ID aScreen) const |
| const INSTANCE_CACHE::ENTRY * | FindInstance (INST_ID aInstance) const |
| const INSTANCE_CACHE & | Instances () const |
| SCREEN_ID | InstanceScreen (INST_ID aInstance) const |
| const SCREEN_FACTS & | InstanceScreenFacts (INST_ID aInstance) const |
| const GEOMETRY_CACHE::ENTRY & | Geometry (SCREEN_ID aScreen) |
| const ISLAND_CACHE::ENTRY & | Islands (SCREEN_ID aScreen, const UNIT_SIGNATURE &aUnits) |
| const ISLAND_CACHE::ENTRY * | FindIslands (SCREEN_ID aScreen, UNIT_VIEW aUnits) const |
| const std::map< SCREEN_ID, uint64_t > & | ScreenRevisions () const |
| std::optional< std::pair< SCREEN_ID, uint64_t > > | VerifiedSymbolSource (SCREEN_ID aScreen) const |
| const TEXT_EVAL::ENVIRONMENT::SOURCE_VALUES * | Sources (INST_ID aInstance) const |
| void | Retain (const std::set< SCREEN_ID > &aScreens, const std::set< INST_ID > &aInstances) |
| void | Invalidate () |
| Force fresh extraction and geometry, retaining primitive values only for change comparison. | |
| void | Clear () |
Private Member Functions | |
| const SCREEN_CACHE::ENTRY & | storeScreen (const SCH_SCREEN &aScreen, SCREEN_FACTS aFacts) |
Private Attributes | |
| SESSION_KEYS & | m_keys |
| SCREEN_CACHE | m_screens |
| FACT_CACHE | m_facts |
| INSTANCE_CACHE | m_instances |
| TEXT_CACHE | m_text |
| AREA_CACHE | m_areas |
| GEOMETRY_CACHE | m_geometry |
| ISLAND_CACHE | m_islands |
| std::map< SCREEN_ID, uint64_t > | m_geometryInputs |
| std::map< ISLAND_KEY, uint64_t, ISLAND_LESS > | m_islandInputs |
| std::map< SCREEN_ID, uint64_t > | m_screenRevisions |
| std::map< SCREEN_ID, uint64_t > | m_symbolRevisions |
| std::map< INST_ID, INSTANCE_INPUT > | m_instanceInputs |
| std::map< INST_ID, TEXT_EVAL::ENVIRONMENT::SOURCE_VALUES > | m_instanceSources |
Main-thread extraction cache.
Returned entries follow CACHE_TABLE's reference lifetime.
Definition at line 40 of file conn_inputs.h.
| using SCH_CONNECTIVITY::INPUT_STORE::AREA_CACHE = CACHE_TABLE<ITEM_KEY, INSTANCE_RULE_AREA_FACT, KEY_LESS> |
Definition at line 48 of file conn_inputs.h.
Definition at line 45 of file conn_inputs.h.
Definition at line 68 of file conn_inputs.h.
Definition at line 46 of file conn_inputs.h.
| using SCH_CONNECTIVITY::INPUT_STORE::ISLAND_CACHE = CACHE_TABLE<ISLAND_KEY, SCREEN_ISLANDS, ISLAND_LESS> |
Definition at line 69 of file conn_inputs.h.
| using SCH_CONNECTIVITY::INPUT_STORE::ISLAND_KEY = std::pair<SCREEN_ID, UNIT_SIGNATURE> |
Definition at line 50 of file conn_inputs.h.
| using SCH_CONNECTIVITY::INPUT_STORE::ISLAND_LOOKUP = std::pair<SCREEN_ID, UNIT_VIEW> |
Definition at line 52 of file conn_inputs.h.
Definition at line 44 of file conn_inputs.h.
| using SCH_CONNECTIVITY::INPUT_STORE::SOURCE_KEY = std::pair<SCREEN_ID, KIID> |
Definition at line 43 of file conn_inputs.h.
Definition at line 47 of file conn_inputs.h.
| using SCH_CONNECTIVITY::INPUT_STORE::UNIT_SIGNATURE = std::vector<std::pair<KIID, int>> |
Definition at line 49 of file conn_inputs.h.
| using SCH_CONNECTIVITY::INPUT_STORE::UNIT_VIEW = std::span<const std::pair<KIID, int>> |
Definition at line 51 of file conn_inputs.h.
| SCH_CONNECTIVITY::INPUT_STORE::INPUT_STORE | ( | CACHE_VERSIONS & | aVersions, |
| SESSION_KEYS & | aKeys ) |
Definition at line 71 of file conn_inputs.cpp.
References m_areas, m_facts, m_geometry, m_instances, m_islands, m_keys, m_screens, and m_text.
|
inline |
Definition at line 93 of file conn_inputs.h.
References m_areas.
Referenced by SCH_CONNECTIVITY::AUXILIARY::Update().
| std::vector< FRAME_INSTANCE > SCH_CONNECTIVITY::INPUT_STORE::Capture | ( | const SCH_SHEET_LIST & | aPaths, |
| uint64_t | aTextEpoch ) |
Definition at line 345 of file conn_inputs.cpp.
References SCH_CONNECTIVITY::CaptureHierarchy(), Clear(), Geometry(), Instance(), m_instances, m_islandInputs, m_islands, m_keys, SCH_CONNECTIVITY::ParallelFor(), path, and Retain().
| void SCH_CONNECTIVITY::INPUT_STORE::Clear | ( | ) |
Definition at line 432 of file conn_inputs.cpp.
References Invalidate(), m_areas, m_facts, m_instances, m_screens, and m_text.
Referenced by Capture(), Geometry(), Instance(), Islands(), and storeScreen().
| bool SCH_CONNECTIVITY::INPUT_STORE::ExternalSourcesChanged | ( | const SCH_SHEET_LIST & | aPaths, |
| bool | aContextUnchanged = false ) const |
Compare retained external inputs for current instance/screen pairs, excluding model/revision changes.
Run outside SOURCE_SCOPE collection in a fresh text frame for each update, keeping that frame alive through the following Capture. Reads populate its cache; reusing an older frame retains older values. Without an active frame, this call owns one. Clock consultations can change on every fresh frame. If the caller has compared global text context, unchanged screen revisions can skip reference replay.
Definition at line 83 of file conn_inputs.cpp.
References SCH_SCREEN::ConnectivityId(), SCH_SCREEN::ConnectivityRevision(), TEXT_EVAL::ENVIRONMENT::Current(), TEXT_EVAL::ENVIRONMENT::CurrentTime(), KIGIT::PROJECT_GIT_UTILS::GetCurrentHash(), PROJECT::GetProjectPath(), TEXT_EVAL::ENVIRONMENT::GitHash(), SCHEMATIC::IsValid(), m_instanceInputs, m_keys, m_screenRevisions, name, path, SCHEMATIC::Project(), TEXT_EVAL_VCS::ReadSource(), SCHEMATIC::ResolveCrossReference(), Sources(), text, and TEXT_EVAL::ENVIRONMENT::VcsValue().
|
inline |
Definition at line 91 of file conn_inputs.h.
References m_facts.
Referenced by SCH_CONNECTIVITY::AUXILIARY::Update().
|
inline |
Definition at line 95 of file conn_inputs.h.
References m_instances.
Referenced by SCH_CONNECTIVITY::AUXILIARY::Update(), and SCH_CONNECTIVITY::RECORD_STORE::Update().
|
inline |
Definition at line 108 of file conn_inputs.h.
References m_islands.
Referenced by SCH_CONNECTIVITY::AUXILIARY::Update().
|
inline |
Definition at line 94 of file conn_inputs.h.
References m_screens.
Referenced by SCH_CONNECTIVITY::AUXILIARY::Update(), and SCH_CONNECTIVITY::RECORD_STORE::Update().
| const INPUT_STORE::GEOMETRY_CACHE::ENTRY & SCH_CONNECTIVITY::INPUT_STORE::Geometry | ( | SCREEN_ID | aScreen | ) |
Definition at line 290 of file conn_inputs.cpp.
References Clear(), SCH_CONNECTIVITY::GeometryOf(), m_geometry, m_geometryInputs, m_screens, and result.
| const INPUT_STORE::INSTANCE_CACHE::ENTRY & SCH_CONNECTIVITY::INPUT_STORE::Instance | ( | const SCH_SCREEN & | aScreen, |
| const SCH_SHEET_PATH & | aPath, | ||
| uint64_t | aTextEpoch ) |
Definition at line 230 of file conn_inputs.cpp.
References Clear(), SCH_SCREEN::ConnectivityId(), SCH_SCREEN::ConnectivityRevision(), TEXT_EVAL::ENVIRONMENT::Current(), empty(), SCH_CONNECTIVITY::ExtractInstanceFacts(), SCH_SHEET_PATH::GetVirtualPageNumber(), SCH_CONNECTIVITY::INSTANCE_FACTS::items, SCH_SHEET_PATH::LastScreen(), m_areas, m_instanceInputs, m_instances, m_instanceSources, m_keys, m_symbolRevisions, m_text, SCH_SHEET_PATH::Path(), result, SCH_CONNECTIVITY::INSTANCE_FACTS::ruleAreas, SCH_CONNECTIVITY::SCREEN_FACTS::ruleAreas, and Screen().
Referenced by Capture().
|
inline |
Definition at line 96 of file conn_inputs.h.
References m_instances.
Definition at line 98 of file conn_inputs.h.
References m_instanceInputs.
Referenced by InstanceScreenFacts().
|
inline |
Definition at line 100 of file conn_inputs.h.
References InstanceScreen(), and m_screens.
| void SCH_CONNECTIVITY::INPUT_STORE::Invalidate | ( | ) |
Force fresh extraction and geometry, retaining primitive values only for change comparison.
Retained values keep their versions when extraction produces an equal value.
Definition at line 419 of file conn_inputs.cpp.
References m_geometry, m_geometryInputs, m_instanceInputs, m_instanceSources, m_islandInputs, m_islands, m_screenRevisions, and m_symbolRevisions.
Referenced by Clear().
| const INPUT_STORE::ISLAND_CACHE::ENTRY & SCH_CONNECTIVITY::INPUT_STORE::Islands | ( | SCREEN_ID | aScreen, |
| const UNIT_SIGNATURE & | aUnits ) |
Definition at line 318 of file conn_inputs.cpp.
References SCH_CONNECTIVITY::BuildScreenIslands(), Clear(), Geometry(), m_islandInputs, m_islands, and result.
Referenced by SCH_CONNECTIVITY::RECORD_STORE::Update().
| void SCH_CONNECTIVITY::INPUT_STORE::Retain | ( | const std::set< SCREEN_ID > & | aScreens, |
| const std::set< INST_ID > & | aInstances ) |
Definition at line 442 of file conn_inputs.cpp.
References m_areas, m_facts, m_geometry, m_geometryInputs, m_instanceInputs, m_instances, m_instanceSources, m_islandInputs, m_islands, m_screenRevisions, m_screens, m_symbolRevisions, and m_text.
Referenced by Capture().
| const INPUT_STORE::SCREEN_CACHE::ENTRY & SCH_CONNECTIVITY::INPUT_STORE::Screen | ( | const SCH_SCREEN & | aScreen | ) |
Definition at line 186 of file conn_inputs.cpp.
References SCH_SCREEN::ConnectivityId(), SCH_SCREEN::ConnectivityRevision(), SCH_SCREEN::ConnectivitySymbolRevision(), SCH_CONNECTIVITY::ExtractScreenFacts(), m_screenRevisions, m_screens, m_symbolRevisions, and storeScreen().
Referenced by Instance().
|
inline |
Definition at line 113 of file conn_inputs.h.
References m_screenRevisions.
Referenced by SCH_CONNECTIVITY::AUXILIARY::Update().
|
inline |
Definition at line 127 of file conn_inputs.h.
References m_instanceSources.
Referenced by ExternalSourcesChanged().
|
private |
Definition at line 204 of file conn_inputs.cpp.
References Clear(), SCH_SCREEN::ConnectivityId(), SCH_SCREEN::ConnectivityRevision(), SCH_SCREEN::ConnectivitySymbolRevision(), empty(), SCH_CONNECTIVITY::SCREEN_FACTS::items, m_facts, m_screenRevisions, m_screens, m_symbolRevisions, and result.
Referenced by Screen().
|
inline |
Definition at line 92 of file conn_inputs.h.
References m_text.
Referenced by SCH_CONNECTIVITY::AUXILIARY::Update().
|
inline |
Definition at line 116 of file conn_inputs.h.
References m_symbolRevisions.
Referenced by SCH_CONNECTIVITY::RECORD_STORE::Update().
|
private |
Definition at line 160 of file conn_inputs.h.
Referenced by Area(), Clear(), INPUT_STORE(), Instance(), and Retain().
|
private |
Definition at line 157 of file conn_inputs.h.
Referenced by Clear(), Fact(), INPUT_STORE(), Retain(), and storeScreen().
|
private |
Definition at line 161 of file conn_inputs.h.
Referenced by Geometry(), INPUT_STORE(), Invalidate(), and Retain().
|
private |
Definition at line 163 of file conn_inputs.h.
Referenced by Geometry(), Invalidate(), and Retain().
|
private |
Definition at line 167 of file conn_inputs.h.
Referenced by ExternalSourcesChanged(), Instance(), InstanceScreen(), Invalidate(), and Retain().
|
private |
Definition at line 158 of file conn_inputs.h.
Referenced by Capture(), Clear(), FindInstance(), INPUT_STORE(), Instance(), Instances(), and Retain().
|
private |
Definition at line 168 of file conn_inputs.h.
Referenced by Instance(), Invalidate(), Retain(), and Sources().
|
private |
Definition at line 164 of file conn_inputs.h.
Referenced by Capture(), Invalidate(), Islands(), and Retain().
|
private |
Definition at line 162 of file conn_inputs.h.
Referenced by Capture(), FindIslands(), INPUT_STORE(), Invalidate(), Islands(), and Retain().
|
private |
Definition at line 155 of file conn_inputs.h.
Referenced by Capture(), ExternalSourcesChanged(), INPUT_STORE(), and Instance().
|
private |
Definition at line 165 of file conn_inputs.h.
Referenced by ExternalSourcesChanged(), Invalidate(), Retain(), Screen(), ScreenRevisions(), and storeScreen().
|
private |
Definition at line 156 of file conn_inputs.h.
Referenced by Clear(), FindScreen(), Geometry(), INPUT_STORE(), InstanceScreenFacts(), Retain(), Screen(), and storeScreen().
|
private |
Definition at line 166 of file conn_inputs.h.
Referenced by Instance(), Invalidate(), Retain(), Screen(), storeScreen(), and VerifiedSymbolSource().
|
private |
Definition at line 159 of file conn_inputs.h.
Referenced by Clear(), INPUT_STORE(), Instance(), Retain(), and Text().