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 3135 of file specctra.h.

Constructor & Destructor Documentation

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

Definition at line 3151 of file specctra.h.

3151  :
3152  ELEM( T_pcb, aParent )
3153  {
3154  parser = 0;
3155  resolution = 0;
3156  unit = 0;
3157  structure = 0;
3158  placement = 0;
3159  library = 0;
3160  network = 0;
3161  wiring = 0;
3162  }
ELEM(DSN_T aType, ELEM *aParent=0)
Definition: specctra.cpp:3490
UNIT_RES * resolution
Definition: specctra.h:3141
STRUCTURE * structure
Definition: specctra.h:3143
WIRING * wiring
Definition: specctra.h:3147
PARSER * parser
Definition: specctra.h:3140
LIBRARY * library
Definition: specctra.h:3145
PLACEMENT * placement
Definition: specctra.h:3144
UNIT_RES * unit
Definition: specctra.h:3142
NETWORK * network
Definition: specctra.h:3146
DSN::PCB::~PCB ( )
inline

Definition at line 3164 of file specctra.h.

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

3165  {
3166  delete parser;
3167  delete resolution;
3168  delete unit;
3169  delete structure;
3170  delete placement;
3171  delete library;
3172  delete network;
3173  delete wiring;
3174  }
UNIT_RES * resolution
Definition: specctra.h:3141
STRUCTURE * structure
Definition: specctra.h:3143
WIRING * wiring
Definition: specctra.h:3147
PARSER * parser
Definition: specctra.h:3140
LIBRARY * library
Definition: specctra.h:3145
PLACEMENT * placement
Definition: specctra.h:3144
UNIT_RES * unit
Definition: specctra.h:3142
NETWORK * network
Definition: specctra.h:3146

Member Function Documentation

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 3176 of file specctra.h.

References DSN::ELEM::Format(), DSN::UNIT_RES::Format(), OUTPUTFORMATTER::GetQuoteChar(), DSN::ELEM::Name(), and OUTPUTFORMATTER::Print().

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

3177  {
3178  const char* quote = out->GetQuoteChar( pcbname.c_str() );
3179 
3180  out->Print( nestLevel, "(%s %s%s%s\n", Name(),
3181  quote, pcbname.c_str(), quote );
3182 
3183  if( parser )
3184  parser->Format( out, nestLevel+1 );
3185 
3186  if( resolution )
3187  resolution->Format( out, nestLevel+1 );
3188 
3189  if( unit )
3190  unit->Format( out, nestLevel+1 );
3191 
3192  if( structure )
3193  structure->Format( out, nestLevel+1 );
3194 
3195  if( placement )
3196  placement->Format( out, nestLevel+1 );
3197 
3198  if( library )
3199  library->Format( out, nestLevel+1 );
3200 
3201  if( network )
3202  network->Format( out, nestLevel+1 );
3203 
3204  if( wiring )
3205  wiring->Format( out, nestLevel+1 );
3206 
3207  out->Print( nestLevel, ")\n" );
3208  }
UNIT_RES * resolution
Definition: specctra.h:3141
STRUCTURE * structure
Definition: specctra.h:3143
WIRING * wiring
Definition: specctra.h:3147
const char * Name() const
Definition: specctra.cpp:3501
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:426
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:3515
PARSER * parser
Definition: specctra.h:3140
static const char * GetQuoteChar(const char *wrapee, const char *quote_char)
Function GetQuoteChar performs quote character need determination according to the Specctra DSN speci...
Definition: richio.cpp:327
LIBRARY * library
Definition: specctra.h:3145
PLACEMENT * placement
Definition: specctra.h:3144
UNIT_RES * unit
Definition: specctra.h:3142
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:404
std::string pcbname
Definition: specctra.h:3139
NETWORK * network
Definition: specctra.h:3146
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 264 of file specctra.h.

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

265  {
266  // overridden in ELEM_HOLDER
267  }
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 3210 of file specctra.h.

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

3211  {
3212  if( unit )
3213  return unit;
3214 
3215  if( resolution )
3216  return resolution->GetUnits();
3217 
3218  return ELEM::GetUnits();
3219  }
virtual UNIT_RES * GetUnits() const
Function GetUnits returns the units for this section.
Definition: specctra.cpp:3506
UNIT_RES * resolution
Definition: specctra.h:3141
UNIT_RES * unit
Definition: specctra.h:3142
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 212 of file specctra.h.

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().

213  {
214  sf.Clear();
215  FormatContents( &sf, 0 );
216  sf.StripUseless();
217 
218  return sf.GetString();
219  }
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:264
const std::string & GetString()
Definition: richio.h:475
void StripUseless()
Function StripUseless removes whitespace, '(', and ')' from the mystring.
Definition: richio.cpp:500
static STRING_FORMATTER sf
Definition: specctra.h:222
void Clear()
Function Clear clears the buffer and empties the internal string.
Definition: richio.h:464

Friends And Related Function Documentation

friend class SPECCTRA_DB
friend

Definition at line 3137 of file specctra.h.

Member Data Documentation

LIBRARY* DSN::PCB::library
private
ELEM* DSN::ELEM::parent
protectedinherited

Definition at line 200 of file specctra.h.

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

PARSER* DSN::PCB::parser
private
std::string DSN::PCB::pcbname
private

Definition at line 3139 of file specctra.h.

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

PLACEMENT* DSN::PCB::placement
private
UNIT_RES* DSN::PCB::resolution
private
STRING_FORMATTER DSN::ELEM::sf
staticprotectedinherited

Definition at line 222 of file specctra.h.

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

DSN_T DSN::ELEM::type
protectedinherited

Definition at line 199 of file specctra.h.

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

UNIT_RES* DSN::PCB::unit
private
WIRING* DSN::PCB::wiring
private

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