KiCad PCB EDA Suite
Loading...
Searching...
No Matches
DSN::ELEM Class Reference

A base class for any DSN element class. More...

#include <specctra.h>

Inheritance diagram for DSN::ELEM:
DSN::ANCESTOR DSN::BOUNDARY DSN::CIRCLE DSN::CLASS DSN::CLASSES DSN::COMPONENT DSN::COMP_ORDER DSN::CONNECT DSN::ELEM_HOLDER DSN::FROMTO DSN::GRID DSN::HISTORY DSN::KEEPOUT DSN::LAYER DSN::LAYER_NOISE_WEIGHT DSN::LAYER_RULE DSN::LIBRARY DSN::NET DSN::NETWORK DSN::NET_OUT DSN::PARSER DSN::PATH DSN::PCB DSN::PIN DSN::PIN_REF DSN::PLACE DSN::PLACEMENT DSN::QARC DSN::RECTANGLE DSN::ROUTE DSN::RULE DSN::SESSION DSN::SPECCTRA_LAYER_PAIR DSN::STRINGPROP DSN::STRUCTURE_OUT DSN::SUPPLY_PIN DSN::TOKPROP DSN::TOPOLOGY DSN::UNIT_RES DSN::VIA DSN::WAS_IS DSN::WINDOW DSN::WIRE DSN::WIRE_VIA DSN::WIRING

Public Member Functions

 ELEM (DSN_T aType, ELEM *aParent=nullptr)
 
virtual ~ELEM ()
 
DSN_T Type () const
 
const char * Name () const
 
virtual UNIT_RESGetUnits () const
 Return the units for this section.
 
virtual void Format (OUTPUTFORMATTER *out, int nestLevel)
 Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
virtual void FormatContents (OUTPUTFORMATTER *out, int nestLevel)
 Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
void SetParent (ELEM *aParent)
 

Protected Member Functions

std::string makeHash ()
 Return a string which uniquely represents this ELEM among other ELEMs of the same derived class as "this" one.
 

Protected Attributes

DSN_T type
 
ELEMparent
 

Static Protected Attributes

static STRING_FORMATTER sf
 

Friends

class SPECCTRA_DB
 

Detailed Description

A base class for any DSN element class.

See class ELEM_HOLDER also.

Definition at line 207 of file specctra.h.

Constructor & Destructor Documentation

◆ ELEM()

DSN::ELEM::ELEM ( DSN_T aType,
ELEM * aParent = nullptr )

Definition at line 3757 of file specctra.cpp.

References ELEM(), parent, T, and type.

Referenced by DSN::ANCESTOR::ANCESTOR(), DSN::ELEM_HOLDER::Append(), DSN::ELEM_HOLDER::At(), DSN::BOUNDARY::BOUNDARY(), DSN::CIRCLE::CIRCLE(), DSN::CLASS::CLASS(), DSN::CLASSES::CLASSES(), DSN::COMP_ORDER::COMP_ORDER(), DSN::COMPONENT::COMPONENT(), DSN::CONNECT::CONNECT(), ELEM(), DSN::ELEM_HOLDER::ELEM_HOLDER(), DSN::FROMTO::FROMTO(), DSN::GRID::GRID(), DSN::HISTORY::HISTORY(), DSN::ELEM_HOLDER::Insert(), DSN::KEEPOUT::KEEPOUT(), DSN::LAYER::LAYER(), DSN::LAYER_NOISE_WEIGHT::LAYER_NOISE_WEIGHT(), DSN::LAYER_RULE::LAYER_RULE(), DSN::LIBRARY::LIBRARY(), DSN::NET::NET(), DSN::NET_OUT::NET_OUT(), DSN::NETWORK::NETWORK(), DSN::ELEM_HOLDER::operator[](), DSN::PARSER::PARSER(), DSN::PATH::PATH(), DSN::PCB::PCB(), DSN::PIN::PIN(), DSN::PIN_REF::PIN_REF(), DSN::PLACE::PLACE(), DSN::PLACEMENT::PLACEMENT(), DSN::QARC::QARC(), DSN::RECTANGLE::RECTANGLE(), DSN::ELEM_HOLDER::Remove(), DSN::ELEM_HOLDER::Replace(), DSN::ROUTE::ROUTE(), DSN::RULE::RULE(), DSN::SESSION::SESSION(), SetParent(), DSN::KEEPOUT::SetShape(), DSN::WINDOW::SetShape(), DSN::WIRE::SetShape(), DSN::SPECCTRA_LAYER_PAIR::SPECCTRA_LAYER_PAIR(), DSN::STRINGPROP::STRINGPROP(), DSN::STRUCTURE_OUT::STRUCTURE_OUT(), DSN::SUPPLY_PIN::SUPPLY_PIN(), DSN::TOKPROP::TOKPROP(), DSN::TOPOLOGY::TOPOLOGY(), DSN::UNIT_RES::UNIT_RES(), DSN::VIA::VIA(), DSN::WAS_IS::WAS_IS(), DSN::WINDOW::WINDOW(), DSN::WIRE::WIRE(), DSN::WIRE_VIA::WIRE_VIA(), and DSN::WIRING::WIRING().

◆ ~ELEM()

DSN::ELEM::~ELEM ( )
virtual

Definition at line 3764 of file specctra.cpp.

Member Function Documentation

◆ Format()

void DSN::ELEM::Format ( OUTPUTFORMATTER * out,
int nestLevel )
virtual

Write this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.

Parameters
outThe formatter to write to.
nestLevelA multiple of the number of spaces to precede the output with.
Exceptions
IO_ERRORif a system error writing the output, such as a full disk.

Reimplemented in DSN::ANCESTOR, DSN::BOUNDARY, DSN::CIRCLE, DSN::CLASS, DSN::COMP_ORDER, DSN::COMPONENT, DSN::CONTROL, DSN::FROMTO, DSN::GRID, DSN::IMAGE, DSN::KEEPOUT, DSN::LAYER, DSN::LAYER_NOISE_WEIGHT, DSN::LAYER_RULE, DSN::NET, DSN::NET_OUT, DSN::PADSTACK, DSN::PATH, DSN::PCB, DSN::PIN, DSN::PLACE, DSN::QARC, DSN::RECTANGLE, DSN::RULE, DSN::SESSION, DSN::SHAPE, DSN::SPECCTRA_LAYER_PAIR, DSN::STRINGPROP, DSN::SUPPLY_PIN, DSN::TOKPROP, DSN::UNIT_RES, DSN::VIA, DSN::WINDOW, DSN::WIRE, and DSN::WIRE_VIA.

Definition at line 3782 of file specctra.cpp.

References FormatContents(), Name(), and OUTPUTFORMATTER::Print().

Referenced by DSN::CONTROL::Format(), DSN::ELEM_HOLDER::FormatContents(), and DSN::STRUCTURE::FormatContents().

◆ FormatContents()

virtual void DSN::ELEM::FormatContents ( OUTPUTFORMATTER * out,
int nestLevel )
inlinevirtual

Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.

This is the same as Format() except that the outer wrapper is not included.

Parameters
outThe formatter to write to.
nestLevelA multiple of the number of spaces to precede the output with.
Exceptions
IO_ERRORif a system error writing the output, such as a full disk.

Reimplemented in DSN::CLASS_CLASS, DSN::CLASSES, DSN::COMPONENT, DSN::ELEM_HOLDER, DSN::HISTORY, DSN::IMAGE, DSN::LIBRARY, DSN::NETWORK, DSN::PADSTACK, DSN::PARSER, DSN::PLACEMENT, DSN::REGION, DSN::ROUTE, DSN::STRUCTURE, DSN::STRUCTURE_OUT, DSN::TOPOLOGY, DSN::WAS_IS, and DSN::WIRING.

Definition at line 247 of file specctra.h.

Referenced by Format(), and makeHash().

◆ GetUnits()

UNIT_RES * DSN::ELEM::GetUnits ( ) const
virtual

Return the units for this section.

Derived classes may override this to check for section specific overrides.

Returns
an element from a local or parent scope.

Reimplemented in DSN::IMAGE, DSN::LIBRARY, DSN::PADSTACK, DSN::PCB, DSN::PLACEMENT, DSN::ROUTE, DSN::STRUCTURE, and DSN::WIRING.

Definition at line 3773 of file specctra.cpp.

References DSN::UNIT_RES::Default, and parent.

Referenced by DSN::SPECCTRA_DB::FromSESSION(), DSN::IMAGE::GetUnits(), DSN::LIBRARY::GetUnits(), DSN::PADSTACK::GetUnits(), DSN::PCB::GetUnits(), DSN::PLACEMENT::GetUnits(), DSN::ROUTE::GetUnits(), DSN::STRUCTURE::GetUnits(), and DSN::WIRING::GetUnits().

◆ makeHash()

std::string DSN::ELEM::makeHash ( )
inlineprotected

Return a string which uniquely represents this ELEM among other ELEMs of the same derived class as "this" one.

It is not usable for all derived classes, only those which plan for it by implementing a FormatContents() function that captures all info which will be used in the subsequent string compare. THIS SHOULD NORMALLY EXCLUDE THE TYPENAME, AND INSTANCE NAME OR ID AS WELL.

Definition at line 268 of file specctra.h.

References FormatContents(), and sf.

Referenced by DSN::IMAGE::Compare(), and DSN::PADSTACK::Compare().

◆ Name()

◆ SetParent()

◆ Type()

Friends And Related Symbol Documentation

◆ SPECCTRA_DB

friend class SPECCTRA_DB
friend

Definition at line 284 of file specctra.h.

References SPECCTRA_DB.

Referenced by SPECCTRA_DB.

Member Data Documentation

◆ parent

ELEM* DSN::ELEM::parent
protected

Definition at line 281 of file specctra.h.

Referenced by ELEM(), GetUnits(), and SetParent().

◆ sf

STRING_FORMATTER DSN::ELEM::sf
staticprotected

Definition at line 278 of file specctra.h.

Referenced by makeHash().

◆ type

DSN_T DSN::ELEM::type
protected

Definition at line 280 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doNET(), ELEM(), DSN::UNIT_RES::Format(), Name(), and Type().


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