KiCad PCB EDA Suite
Loading...
Searching...
No Matches
erc_sch_pin_context.cpp
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 (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
5* Copyright (C) 2011 Wayne Stambaugh <[email protected]>
6* Copyright The KiCad Developers, see AUTHORS.txt for contributors.
7*
8* This program is free software; you can redistribute it and/or
9* modify it under the terms of the GNU General Public License
10* as published by the Free Software Foundation; either version 2
11* of the License, or (at your option) any later version.
12*
13* This program is distributed in the hope that it will be useful,
14* but WITHOUT ANY WARRANTY; without even the implied warranty of
15* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16* GNU General Public License for more details.
17*
18* You should have received a copy of the GNU General Public License
19* along with this program. If not, see <https://www.gnu.org/licenses/>.
20*/
21
25
27
28
30{
31 return m_pin;
32}
33
34
36{
37 return m_sheet;
38}
39
40
42{
43 if( m_sheet.PathRef() != other.m_sheet.PathRef() )
44 return false;
45
46 if( m_pin && other.m_pin )
47 return m_pin->m_Uuid == other.m_pin->m_Uuid;
48
49 return m_pin == other.m_pin;
50}
51
52
54{
55 if( m_sheet.PathRef() != other.m_sheet.PathRef() )
56 return m_sheet.PathRef() < other.m_sheet.PathRef();
57
58 if( !m_pin || !other.m_pin )
59 return !m_pin && other.m_pin;
60
61 return m_pin->m_Uuid < other.m_pin->m_Uuid;
62}
const KIID m_Uuid
Definition eda_item.h:597
bool operator<(const ERC_SCH_PIN_CONTEXT &other) const
Order by sheet instance and pin UUID, with null pins preceding live pins.
const SCH_SHEET_PATH & Sheet() const
Get the SCH_SHEET_PATH context for the paired SCH_PIN.
ERC_SCH_PIN_CONTEXT()=default
SCH_PIN * Pin() const
Get the SCH_PIN for this context.
bool operator==(const ERC_SCH_PIN_CONTEXT &other) const
Compare the exact sheet instance and pin UUID.
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
const KIID_PATH & PathRef() const
Borrow the cached path until this sheet path is modified or destroyed.