KiCad PCB EDA Suite
Loading...
Searching...
No Matches
conn_auxiliary.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_records.h"
23#include "conn_changes.h"
24
25#include <set>
26
27namespace SCH_CONNECTIVITY
28{
30{
31 std::vector<KIID> items;
32 std::vector<std::pair<KIID, KIID>> adjacency;
33 std::map<KIID, uint8_t> dangling;
34 std::vector<std::pair<KIID, KIID>> busEntryLinks;
35 std::vector<std::pair<KIID, KIID>> ncContacts;
37};
38
40{
41 std::vector<KIID> containedItems;
42 std::vector<KIID> attachedDirectives;
43 std::vector<NAME_ID> netclasses;
44 bool operator==( const RULE_AREA_RESULT& ) const = default;
45};
46
51{
52public:
54 {
55 uint64_t islandVersion = 0;
56 uint64_t recordVersion = 0;
58 };
60 {
61 uint64_t version = 0;
63 };
64 using ISLANDS = std::map<RECORD_KEY, ISLAND_ENTRY, KEY_LESS>;
65 using AREAS = std::map<ITEM_KEY, AREA_ENTRY, KEY_LESS>;
66 using ISLAND_INDEX = std::map<ITEM_KEY, RECORD_KEY, KEY_LESS>;
67 using AREA_INDEX = std::map<ITEM_KEY, std::vector<KIID>, KEY_LESS>;
68
69 using NEIGHBOR_INDEX = std::map<ITEM_KEY, std::vector<KIID>, KEY_LESS>;
70
71 explicit AUXILIARY( SESSION_KEYS& aKeys );
72
78 void Update( std::span<const FRAME_INSTANCE> aFrame, const INPUT_STORE& aInputs,
79 const RECORD_STORE::RECORD_CACHE& aRecords, CHANGE_SET& aChanges );
80 void Clear();
81
82 const ISLANDS& Islands() const { return m_islands; }
83 const AREAS& RuleAreas() const { return m_areas; }
84 const ISLAND_INDEX& IslandOf() const { return m_islandOf; }
85 const NEIGHBOR_INDEX& NeighborsOf() const { return m_neighborsOf; }
86 const AREA_INDEX& RuleAreasOf() const { return m_ruleAreasOf; }
87 const std::map<SCREEN_ID, uint64_t>& ScreenRevisions() const { return m_screenRevisions; }
88
89private:
96 std::map<SCREEN_ID, uint64_t> m_screenRevisions;
97 std::set<INST_ID> m_instances;
98 uint64_t m_sourceVersion = 0;
99};
100} // namespace SCH_CONNECTIVITY
std::map< ITEM_KEY, RECORD_KEY, KEY_LESS > ISLAND_INDEX
std::map< ITEM_KEY, std::vector< KIID >, KEY_LESS > AREA_INDEX
std::map< ITEM_KEY, AREA_ENTRY, KEY_LESS > AREAS
const ISLAND_INDEX & IslandOf() const
const std::map< SCREEN_ID, uint64_t > & ScreenRevisions() const
const AREA_INDEX & RuleAreasOf() const
const ISLANDS & Islands() const
std::set< INST_ID > m_instances
std::map< RECORD_KEY, ISLAND_ENTRY, KEY_LESS > ISLANDS
const AREAS & RuleAreas() const
AUXILIARY(SESSION_KEYS &aKeys)
std::map< ITEM_KEY, std::vector< KIID >, KEY_LESS > NEIGHBOR_INDEX
std::map< SCREEN_ID, uint64_t > m_screenRevisions
void Update(std::span< const FRAME_INSTANCE > aFrame, const INPUT_STORE &aInputs, const RECORD_STORE::RECORD_CACHE &aRecords, CHANGE_SET &aChanges)
Publish the changed islands and rule areas.
const NEIGHBOR_INDEX & NeighborsOf() const
Main-thread extraction cache.
Definition conn_inputs.h:41
CACHE_TABLE< RECORD_KEY, ISLAND_RECORD, KEY_LESS > RECORD_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.
RULE_AREA_RESULT value
uint64_t version
ISLAND_AUX value
uint64_t recordVersion
Version of the electrical record of the island.
uint64_t islandVersion
Geometry version of the screen islands.
Difference between two publications.
std::vector< std::pair< KIID, KIID > > ncContacts
std::vector< std::pair< KIID, KIID > > adjacency
std::vector< std::pair< KIID, KIID > > busEntryLinks
std::vector< KIID > items
std::map< KIID, uint8_t > dangling
Orders keys by value through SESSION_KEYS::Less().
Definition conn_keys.h:255
std::vector< NAME_ID > netclasses
bool operator==(const RULE_AREA_RESULT &) const =default
std::vector< KIID > attachedDirectives