KiCad PCB EDA Suite
BUS_ALIAS Class Reference

#include <bus_alias.h>

Public Member Functions

 BUS_ALIAS (SCH_SCREEN *aParent=nullptr)
 
 ~BUS_ALIAS ()
 
std::shared_ptr< BUS_ALIASClone () const
 
wxString GetName ()
 
void SetName (const wxString &aName)
 
void ClearMembers ()
 
void AddMember (const wxString &aName)
 
int GetMemberCount ()
 
wxArrayString & Members ()
 
bool Contains (const wxString &aName)
 
SCH_SCREENGetParent ()
 
void SetParent (SCH_SCREEN *aParent)
 

Protected Attributes

wxString m_name
 
wxArrayString m_members
 
SCH_SCREENm_parent
 The bus alias editor dialog can edit aliases from all open sheets. More...
 

Detailed Description

Definition at line 33 of file bus_alias.h.

Constructor & Destructor Documentation

◆ BUS_ALIAS()

BUS_ALIAS::BUS_ALIAS ( SCH_SCREEN aParent = nullptr)

Definition at line 25 of file bus_alias.cpp.

25  :
26  m_parent( aParent )
27 {
28 }
SCH_SCREEN * m_parent
The bus alias editor dialog can edit aliases from all open sheets.
Definition: bus_alias.h:98

◆ ~BUS_ALIAS()

BUS_ALIAS::~BUS_ALIAS ( )

Definition at line 31 of file bus_alias.cpp.

32 {
33 }

Member Function Documentation

◆ AddMember()

void BUS_ALIAS::AddMember ( const wxString &  aName)
inline

Definition at line 60 of file bus_alias.h.

61  {
62  m_members.push_back( aName );
63  }
wxArrayString m_members
Definition: bus_alias.h:91

References m_members.

◆ ClearMembers()

void BUS_ALIAS::ClearMembers ( )
inline

Definition at line 55 of file bus_alias.h.

56  {
57  m_members.clear();
58  }
wxArrayString m_members
Definition: bus_alias.h:91

References m_members.

◆ Clone()

std::shared_ptr< BUS_ALIAS > BUS_ALIAS::Clone ( ) const
inline

Definition at line 40 of file bus_alias.h.

41  {
42  return std::make_shared< BUS_ALIAS >( *this );
43  }

◆ Contains()

bool BUS_ALIAS::Contains ( const wxString &  aName)

Definition at line 36 of file bus_alias.cpp.

37 {
38  return alg::contains( m_members, aName );
39 }
wxArrayString m_members
Definition: bus_alias.h:91
bool contains(const _Container &__container, _Value __value)
Returns true if the container contains the given value.
Definition: kicad_algo.h:99

References alg::contains(), and m_members.

◆ GetMemberCount()

int BUS_ALIAS::GetMemberCount ( )
inline

Definition at line 65 of file bus_alias.h.

66  {
67  return m_members.size();
68  }
wxArrayString m_members
Definition: bus_alias.h:91

References m_members.

◆ GetName()

wxString BUS_ALIAS::GetName ( void  )
inline

Definition at line 45 of file bus_alias.h.

46  {
47  return m_name;
48  }
wxString m_name
Definition: bus_alias.h:89

References m_name.

◆ GetParent()

SCH_SCREEN* BUS_ALIAS::GetParent ( void  )
inline

Definition at line 77 of file bus_alias.h.

78  {
79  return m_parent;
80  }
SCH_SCREEN * m_parent
The bus alias editor dialog can edit aliases from all open sheets.
Definition: bus_alias.h:98

References m_parent.

◆ Members()

wxArrayString& BUS_ALIAS::Members ( )
inline

Definition at line 70 of file bus_alias.h.

71  {
72  return m_members;
73  }
wxArrayString m_members
Definition: bus_alias.h:91

References m_members.

◆ SetName()

void BUS_ALIAS::SetName ( const wxString &  aName)
inline

Definition at line 50 of file bus_alias.h.

51  {
52  m_name = aName;
53  }
wxString m_name
Definition: bus_alias.h:89

References m_name.

◆ SetParent()

void BUS_ALIAS::SetParent ( SCH_SCREEN aParent)
inline

Definition at line 82 of file bus_alias.h.

83  {
84  m_parent = aParent;
85  }
SCH_SCREEN * m_parent
The bus alias editor dialog can edit aliases from all open sheets.
Definition: bus_alias.h:98

References m_parent.

Member Data Documentation

◆ m_members

wxArrayString BUS_ALIAS::m_members
protected

Definition at line 91 of file bus_alias.h.

Referenced by AddMember(), ClearMembers(), Contains(), GetMemberCount(), and Members().

◆ m_name

wxString BUS_ALIAS::m_name
protected

Definition at line 89 of file bus_alias.h.

Referenced by GetName(), and SetName().

◆ m_parent

SCH_SCREEN* BUS_ALIAS::m_parent
protected

The bus alias editor dialog can edit aliases from all open sheets.

This means we have to store a reference back to our parent so that the dialog can update the parent if aliases are changed or removed.

Definition at line 98 of file bus_alias.h.

Referenced by GetParent(), and SetParent().


The documentation for this class was generated from the following files: