KiCad PCB EDA Suite
Loading...
Searching...
No Matches
bus_alias.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 (C) 2018 CERN
5 * Copyright (C) 2021-2022 KiCad Developers, see AUTHORS.txt for contributors.
6 * @author Jon Evans <[email protected]>
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 along
19 * with this program. If not, see <http://www.gnu.org/licenses/>.
20 */
21
22#ifndef _BUS_ALIAS_H
23#define _BUS_ALIAS_H
24
25#include <memory>
26#include <vector>
27#include <wx/string.h>
28
29
30class SCH_SCREEN;
31
32
34{
35public:
36 BUS_ALIAS( SCH_SCREEN* aParent = nullptr ) :
37 m_parent( aParent )
38 { }
39
41 { }
42
43 std::shared_ptr<BUS_ALIAS> Clone() const
44 {
45 return std::make_shared<BUS_ALIAS>( *this );
46 }
47
48 wxString GetName() { return m_name; }
49 void SetName( const wxString& aName ) { m_name = aName; }
50
51 const std::vector<wxString>& Members() const { return m_members; }
52 std::vector<wxString>& Members() { return m_members; }
53
55 void SetParent( SCH_SCREEN* aParent ) { m_parent = aParent; }
56
57protected:
58 wxString m_name;
59 std::vector<wxString> m_members;
60
66};
67
68#endif
void SetParent(SCH_SCREEN *aParent)
Definition: bus_alias.h:55
void SetName(const wxString &aName)
Definition: bus_alias.h:49
std::vector< wxString > & Members()
Definition: bus_alias.h:52
wxString GetName()
Definition: bus_alias.h:48
SCH_SCREEN * m_parent
Schematic Setup can edit aliases from all sheets, so we have to store a reference back to our parent ...
Definition: bus_alias.h:65
std::shared_ptr< BUS_ALIAS > Clone() const
Definition: bus_alias.h:43
SCH_SCREEN * GetParent()
Definition: bus_alias.h:54
wxString m_name
Definition: bus_alias.h:58
std::vector< wxString > m_members
Definition: bus_alias.h:59
~BUS_ALIAS()
Definition: bus_alias.h:40
BUS_ALIAS(SCH_SCREEN *aParent=nullptr)
Definition: bus_alias.h:36
const std::vector< wxString > & Members() const
Definition: bus_alias.h:51