KiCad PCB EDA Suite
DSN::PCB Class Reference

#include <specctra.h>

Inheritance diagram for DSN::PCB:
DSN::ELEM

Public Member Functions

 PCB (ELEM *aParent=0)
 
 ~PCB ()
 
void Format (OUTPUTFORMATTER *out, int nestLevel) override
 Function Format writes this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format. More...
 
UNIT_RESGetUnits () const override
 Function GetUnits returns the units for this section. More...
 
DSN_T Type () const
 
const char * Name () const
 
virtual void FormatContents (OUTPUTFORMATTER *out, int nestLevel)
 Function FormatContents writes the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format. More...
 
void SetParent (ELEM *aParent)
 

Protected Member Functions

std::string makeHash ()
 Function makeHash returns a string which uniquely represents this ELEM amoung other ELEMs of the same derived class as "this" one. More...
 

Protected Attributes

DSN_T type
 
ELEMparent
 

Static Protected Attributes

static STRING_FORMATTER sf
 

Private Attributes

std::string pcbname
 
PARSERparser
 
UNIT_RESresolution
 
UNIT_RESunit
 
STRUCTUREstructure
 
PLACEMENTplacement
 
LIBRARYlibrary
 
NETWORKnetwork
 
WIRINGwiring
 

Friends

class SPECCTRA_DB
 

Detailed Description

Definition at line 3161 of file specctra.h.

Constructor & Destructor Documentation

◆ PCB()

DSN::PCB::PCB ( ELEM aParent = 0)
inline

Definition at line 3177 of file specctra.h.

3177  :
3178  ELEM( T_pcb, aParent )
3179  {
3180  parser = 0;
3181  resolution = 0;
3182  unit = 0;
3183  structure = 0;
3184  placement = 0;
3185  library = 0;
3186  network = 0;
3187  wiring = 0;
3188  }
ELEM(DSN_T aType, ELEM *aParent=0)
Definition: specctra.cpp:3494
UNIT_RES * resolution
Definition: specctra.h:3167
STRUCTURE * structure
Definition: specctra.h:3169
WIRING * wiring
Definition: specctra.h:3173
PARSER * parser
Definition: specctra.h:3166
LIBRARY * library
Definition: specctra.h:3171
PLACEMENT * placement
Definition: specctra.h:3170
UNIT_RES * unit
Definition: specctra.h:3168
NETWORK * network
Definition: specctra.h:3172

References library, network, parser, placement, resolution, structure, unit, and wiring.

◆ ~PCB()

DSN::PCB::~PCB ( )
inline

Definition at line 3190 of file specctra.h.

3191  {
3192  delete parser;
3193  delete resolution;
3194  delete unit;
3195  delete structure;
3196  delete placement;
3197  delete library;
3198  delete network;
3199  delete wiring;
3200  }
UNIT_RES * resolution
Definition: specctra.h:3167
STRUCTURE * structure
Definition: specctra.h:3169
WIRING * wiring
Definition: specctra.h:3173
PARSER * parser
Definition: specctra.h:3166
LIBRARY * library
Definition: specctra.h:3171
PLACEMENT * placement
Definition: specctra.h:3170
UNIT_RES * unit
Definition: specctra.h:3168
NETWORK * network
Definition: specctra.h:3172

References library, network, parser, placement, resolution, structure, unit, and wiring.

Member Function Documentation

◆ Format()

void DSN::PCB::Format ( OUTPUTFORMATTER out,
int  nestLevel 
)
inlineoverridevirtual

Function Format writes 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 preceed the output with.
Exceptions
IO_ERRORif a system error writing the output, such as a full disk.

Reimplemented from DSN::ELEM.

Definition at line 3202 of file specctra.h.

3203  {
3204  const char* quote = out->GetQuoteChar( pcbname.c_str() );
3205 
3206  out->Print( nestLevel, "(%s %s%s%s\n", Name(),
3207  quote, pcbname.c_str(), quote );
3208 
3209  if( parser )
3210  parser->Format( out, nestLevel+1 );
3211 
3212  if( resolution )
3213  resolution->Format( out, nestLevel+1 );
3214 
3215  if( unit )
3216  unit->Format( out, nestLevel+1 );
3217 
3218  if( structure )
3219  structure->Format( out, nestLevel+1 );
3220 
3221  if( placement )
3222  placement->Format( out, nestLevel+1 );
3223 
3224  if( library )
3225  library->Format( out, nestLevel+1 );
3226 
3227  if( network )
3228  network->Format( out, nestLevel+1 );
3229 
3230  if( wiring )
3231  wiring->Format( out, nestLevel+1 );
3232 
3233  out->Print( nestLevel, ")\n" );
3234  }
const char * Name() const
Definition: specctra.cpp:3505
UNIT_RES * resolution
Definition: specctra.h:3167
STRUCTURE * structure
Definition: specctra.h:3169
WIRING * wiring
Definition: specctra.h:3173
void Format(OUTPUTFORMATTER *out, int nestLevel) override
Function Format writes this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN f...
Definition: specctra.h:425
virtual void Format(OUTPUTFORMATTER *out, int nestLevel)
Function Format writes this object as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN f...
Definition: specctra.cpp:3519
PARSER * parser
Definition: specctra.h:3166
static const char * GetQuoteChar(const char *wrapee, const char *quote_char)
Perform quote character need determination according to the Specctra DSN specification.
Definition: richio.cpp:331
LIBRARY * library
Definition: specctra.h:3171
PLACEMENT * placement
Definition: specctra.h:3170
UNIT_RES * unit
Definition: specctra.h:3168
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Format and write text to the output stream.
Definition: richio.cpp:408
std::string pcbname
Definition: specctra.h:3165
NETWORK * network
Definition: specctra.h:3172

References DSN::ELEM::Format(), DSN::UNIT_RES::Format(), OUTPUTFORMATTER::GetQuoteChar(), library, DSN::ELEM::Name(), network, parser, pcbname, placement, OUTPUTFORMATTER::Print(), resolution, structure, unit, and wiring.

Referenced by DSN::SPECCTRA_DB::ExportPCB(), and main().

◆ FormatContents()

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

Function FormatContents writes 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 preceed the output with.
Exceptions
IO_ERRORif a system error writing the output, such as a full disk.

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

Definition at line 263 of file specctra.h.

264  {
265  // overridden in ELEM_HOLDER
266  }

Referenced by DSN::ELEM::Format(), and DSN::ELEM::makeHash().

◆ GetUnits()

UNIT_RES* DSN::PCB::GetUnits ( ) const
inlineoverridevirtual

Function GetUnits returns the units for this section.

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

Returns
UNIT_RES* - from a local or parent scope

Reimplemented from DSN::ELEM.

Definition at line 3236 of file specctra.h.

3237  {
3238  if( unit )
3239  return unit;
3240 
3241  if( resolution )
3242  return resolution->GetUnits();
3243 
3244  return ELEM::GetUnits();
3245  }
UNIT_RES * resolution
Definition: specctra.h:3167
UNIT_RES * unit
Definition: specctra.h:3168
virtual UNIT_RES * GetUnits() const
Function GetUnits returns the units for this section.
Definition: specctra.cpp:3510

References DSN::ELEM::GetUnits(), resolution, and unit.

◆ makeHash()

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

Function makeHash returns a string which uniquely represents this ELEM amoung other ELEMs of the same derived class as "this" one.

It is not useable 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 211 of file specctra.h.

212  {
213  sf.Clear();
214  FormatContents( &sf, 0 );
215  sf.StripUseless();
216 
217  return sf.GetString();
218  }
virtual void FormatContents(OUTPUTFORMATTER *out, int nestLevel)
Function FormatContents writes the contents as ASCII out to an OUTPUTFORMATTER according to the SPECC...
Definition: specctra.h:263
const std::string & GetString()
Definition: richio.h:435
void StripUseless()
Removes whitespace, '(', and ')' from the string.
Definition: richio.cpp:494
static STRING_FORMATTER sf
Definition: specctra.h:221
void Clear()
Clear the buffer and empties the internal string.
Definition: richio.h:425

References STRING_FORMATTER::Clear(), DSN::ELEM::FormatContents(), STRING_FORMATTER::GetString(), DSN::ELEM::sf, and STRING_FORMATTER::StripUseless().

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

◆ Name()

◆ SetParent()

◆ Type()

Friends And Related Function Documentation

◆ SPECCTRA_DB

friend class SPECCTRA_DB
friend

Definition at line 3163 of file specctra.h.

Member Data Documentation

◆ library

LIBRARY* DSN::PCB::library
private

◆ network

◆ parent

ELEM* DSN::ELEM::parent
protectedinherited

Definition at line 199 of file specctra.h.

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

◆ parser

PARSER* DSN::PCB::parser
private

◆ pcbname

std::string DSN::PCB::pcbname
private

Definition at line 3165 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doPCB(), DSN::SPECCTRA_DB::ExportPCB(), and Format().

◆ placement

PLACEMENT* DSN::PCB::placement
private

◆ resolution

UNIT_RES* DSN::PCB::resolution
private

◆ sf

STRING_FORMATTER DSN::ELEM::sf
staticprotectedinherited

Definition at line 221 of file specctra.h.

Referenced by DSN::ELEM::makeHash().

◆ structure

◆ type

DSN_T DSN::ELEM::type
protectedinherited

Definition at line 198 of file specctra.h.

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

◆ unit

UNIT_RES* DSN::PCB::unit
private

◆ wiring

WIRING* DSN::PCB::wiring
private

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