KiCad PCB EDA Suite
Loading...
Searching...
No Matches
conn_frame.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_keys.h"
23#include <wx/string.h>
24
25class SCH_SHEET_LIST;
26
27namespace SCH_CONNECTIVITY
28{
35{
37 wxString path;
38 uint16_t depth = 0;
39 // Only instantiated children contribute hierarchy port edges.
40 std::map<KIID, INST_ID> children;
41 bool operator==( const INSTANCE_SCOPE& ) const = default;
42};
43
48{
51 bool operator==( const FRAME_INSTANCE& ) const = default;
52};
53
54// Canonical instance descriptors; missing screens do not expose child ports.
58std::vector<FRAME_INSTANCE> CaptureHierarchy( const SCH_SHEET_LIST& aPaths, SESSION_KEYS& aKeys );
59
60} // namespace SCH_CONNECTIVITY
Session IDs are dense handles, never a canonical ordering.
Definition conn_keys.h:146
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
Value keys and the key session of the schematic connectivity engine.
uint32_t INST_ID
Session handle of a sheet instance KIID_PATH.
Definition conn_keys.h:41
uint64_t SCREEN_ID
Process-local SCH_SCREEN::ConnectivityId(), never a file UUID.
Definition conn_keys.h:44
constexpr uint32_t INVALID_ID
Marks an unset handle.
Definition conn_keys.h:47
std::vector< FRAME_INSTANCE > CaptureHierarchy(const SCH_SHEET_LIST &aPaths, SESSION_KEYS &aKeys)
Interns every sheet instance and returns the frame in KIID_PATH order, so each parent precedes its ch...
One entry of the captured hierarchy.
Definition conn_frame.h:48
SCREEN_ID screen
The screen that the instance shows. Many instances can share it.
Definition conn_frame.h:50
bool operator==(const FRAME_INSTANCE &) const =default
The hierarchy position of one sheet instance.
Definition conn_frame.h:35
std::map< KIID, INST_ID > children
The child instance of each SCH_SHEET KIID on this screen.
Definition conn_frame.h:40
wxString path
The human-readable sheet path, which prefixes scoped names.
Definition conn_frame.h:37
INST_ID instance
The session handle of the instance KIID_PATH.
Definition conn_frame.h:36
bool operator==(const INSTANCE_SCOPE &) const =default
uint16_t depth
The number of sheets in the path, with the root sheet as one.
Definition conn_frame.h:38