KiCad PCB EDA Suite
Loading...
Searching...
No Matches
SCH_CONNECTIVITY::BUS_SCHEMA Struct Reference

The parsed form of one bus text. More...

#include <conn_bus.h>

Classes

struct  LEAF
 One member net. More...
 
struct  NODE
 One node of the presentation tree. More...
 

Public Types

enum class  SHAPE { VECTOR , GROUP }
 

Public Member Functions

bool operator== (const BUS_SCHEMA &aOther) const
 Compare the electrical schema only.
 

Static Public Member Functions

static std::optional< BUS_SCHEMAParse (const wxString &aText, const BUS_ALIASES &aAliases={})
 Parse a vector or group bus text.
 

Public Attributes

SHAPE shape = SHAPE::GROUP
 
wxString prefix
 Root prefix, such as D or I2C. It is empty for an unnamed group.
 
size_t prefixEnd = 0
 End of the root prefix in the escaped input text.
 
std::vector< LEAFleaves
 Member nets in declaration order, with nested buses flattened.
 
NODE root
 Presentation tree. BUS_PARSE_CACHE stores it apart from the schema.
 
std::set< wxString > aliasesUsed
 Every member name that the parser looked up in the alias table.
 

Detailed Description

The parsed form of one bus text.

The flat leaves define the electrical members. The tree keeps nested buses for presentation only.

Definition at line 47 of file conn_bus.h.

Member Enumeration Documentation

◆ SHAPE

Enumerator
VECTOR 

A range such as D[0..3]. Members align by ordinal.

GROUP 

A list such as I2C{SDA SCL}. Members align by name with another group.

Definition at line 49 of file conn_bus.h.

Member Function Documentation

◆ operator==()

bool SCH_CONNECTIVITY::BUS_SCHEMA::operator== ( const BUS_SCHEMA & aOther) const
inline

Compare the electrical schema only.

Alias dependencies and presentation can change without an electrical change, and such a change must not create a new record version.

Definition at line 109 of file conn_bus.h.

References leaves, prefix, and shape.

◆ Parse()

std::optional< SCH_CONNECTIVITY::BUS_SCHEMA > SCH_CONNECTIVITY::BUS_SCHEMA::Parse ( const wxString & aText,
const BUS_ALIASES & aAliases = {} )
static

Parse a vector or group bus text.

Input and output names use CTX_NETNAME escaping. Alias definitions are unescaped text.

Returns
no value for scalar text, malformed text or an alias cycle.

Definition at line 186 of file conn_bus.cpp.

Referenced by BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), BOOST_AUTO_TEST_CASE(), and BOOST_AUTO_TEST_CASE().

Member Data Documentation

◆ aliasesUsed

std::set<wxString> SCH_CONNECTIVITY::BUS_SCHEMA::aliasesUsed

Every member name that the parser looked up in the alias table.

A lookup that found no alias is also a dependency, because a later alias definition can change these leaves.

Definition at line 104 of file conn_bus.h.

◆ leaves

std::vector<LEAF> SCH_CONNECTIVITY::BUS_SCHEMA::leaves

Member nets in declaration order, with nested buses flattened.

Definition at line 98 of file conn_bus.h.

Referenced by SCH_CONNECTIVITY::Align(), and operator==().

◆ prefix

wxString SCH_CONNECTIVITY::BUS_SCHEMA::prefix

Root prefix, such as D or I2C. It is empty for an unnamed group.

Definition at line 92 of file conn_bus.h.

Referenced by SCH_CONNECTIVITY::ApplyNameSuffix(), and operator==().

◆ prefixEnd

size_t SCH_CONNECTIVITY::BUS_SCHEMA::prefixEnd = 0

End of the root prefix in the escaped input text.

It is nonzero only for a named group, whose quotes and escapes can make this length differ from the length of BUS_SCHEMA::prefix.

Definition at line 97 of file conn_bus.h.

Referenced by SCH_CONNECTIVITY::ApplyNameSuffix().

◆ root

NODE SCH_CONNECTIVITY::BUS_SCHEMA::root

Presentation tree. BUS_PARSE_CACHE stores it apart from the schema.

Definition at line 99 of file conn_bus.h.

◆ shape

SHAPE SCH_CONNECTIVITY::BUS_SCHEMA::shape = SHAPE::GROUP

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