KiCad PCB EDA Suite
Loading...
Searching...
No Matches
conn_records.h
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
22#include "conn_claims.h"
23#include "conn_inputs.h"
24
25namespace SCH_CONNECTIVITY
26{
33{
34public:
37
38 RECORD_STORE( CACHE_VERSIONS& aVersions, SESSION_KEYS& aKeys );
39
40 // Frame and inputs must come from the same INPUT_STORE capture and key session.
41 void Update( const std::vector<FRAME_INSTANCE>& aFrame, INPUT_STORE& aInputs, const BUS_ALIASES& aAliases );
42 const RECORD_CACHE& Records() const { return m_records; }
43 void Clear();
44
45 // Presentation is stored separately from the electrical schemas retained by claims.
46 std::shared_ptr<const BUS_SCHEMA::NODE> FindTree( const wxString& aText ) const
47 {
48 return m_parses.FindTree( aText );
49 }
50
51private:
54 {
55 uint64_t sourceVersion;
56 uint64_t textVersion;
58 std::optional<std::pair<SCREEN_ID, uint64_t>> symbolSource;
59 size_t factCount;
60 std::vector<KIID> items;
61 };
62
65 {
66 bool hasWire;
68 std::vector<std::pair<KIID, uint64_t>> items;
69 bool operator==( const RECORD_INPUT& ) const = default;
70 };
71
73 {
74 bool operator()( const RECORD_KEY& aLeft, const RECORD_KEY& aRight ) const
75 {
76 return aLeft.inst != aRight.inst ? aLeft.inst < aRight.inst : aLeft.anchor < aRight.anchor;
77 }
78 };
79
84 std::map<INST_ID, PREPARED_INSTANCE> m_prepared;
85 std::map<RECORD_KEY, RECORD_INPUT, RECORD_ORDER> m_recordInputs;
86};
87} // namespace SCH_CONNECTIVITY
Parse results for each bus text, with invalidation by alias dependency.
Definition conn_bus.h:130
Versioned value table.
Definition conn_cache.h:61
One sequence for all cache tables for the lifetime of an engine session.
Definition conn_cache.h:37
Main-thread extraction cache.
Definition conn_inputs.h:41
const RECORD_CACHE & Records() const
std::map< INST_ID, PREPARED_INSTANCE > m_prepared
std::map< RECORD_KEY, RECORD_INPUT, RECORD_ORDER > m_recordInputs
CACHE_TABLE< RECORD_KEY, ISLAND_RECORD, KEY_LESS > RECORD_CACHE
void Update(const std::vector< FRAME_INSTANCE > &aFrame, INPUT_STORE &aInputs, const BUS_ALIASES &aAliases)
RECORD_STORE(CACHE_VERSIONS &aVersions, SESSION_KEYS &aKeys)
std::shared_ptr< const BUS_SCHEMA::NODE > FindTree(const wxString &aText) const
CACHE_TABLE< ITEM_KEY, SOURCE_CLAIMS, KEY_LESS > SOURCE_CACHE
Session IDs are dense handles, never a canonical ordering.
Definition conn_keys.h:146
Value keys and the key session of the schematic connectivity engine.
std::map< wxString, std::vector< wxString > > BUS_ALIASES
Bus alias table, from alias name to member texts.
Definition conn_bus.h:40
The hierarchy position of one sheet instance.
Definition conn_frame.h:35
One island in one sheet instance.
Definition conn_keys.h:87
INST_ID inst
The sheet instance of the record.
Definition conn_keys.h:88
KIID anchor
ISLAND::anchor, the smallest item KIID in the island.
Definition conn_keys.h:89
Input versions and scope that produced the current source claims of one instance.
std::optional< std::pair< SCREEN_ID, uint64_t > > symbolSource
Everything BuildIslandRecord() reads, as island flags and source claim versions.
std::vector< std::pair< KIID, uint64_t > > items
bool operator==(const RECORD_INPUT &) const =default
bool operator()(const RECORD_KEY &aLeft, const RECORD_KEY &aRight) const