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 throw ( IO_ERROR )
 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) throw ( IO_ERROR )
 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 3132 of file specctra.h.

Constructor & Destructor Documentation

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

Definition at line 3148 of file specctra.h.

3148  :
3149  ELEM( T_pcb, aParent )
3150  {
3151  parser = 0;
3152  resolution = 0;
3153  unit = 0;
3154  structure = 0;
3155  placement = 0;
3156  library = 0;
3157  network = 0;
3158  wiring = 0;
3159  }
ELEM(DSN_T aType, ELEM *aParent=0)
Definition: specctra.cpp:3486
UNIT_RES * resolution
Definition: specctra.h:3138
STRUCTURE * structure
Definition: specctra.h:3140
WIRING * wiring
Definition: specctra.h:3144
PARSER * parser
Definition: specctra.h:3137
LIBRARY * library
Definition: specctra.h:3142
PLACEMENT * placement
Definition: specctra.h:3141
UNIT_RES * unit
Definition: specctra.h:3139
NETWORK * network
Definition: specctra.h:3143
DSN::PCB::~PCB ( )
inline

Definition at line 3161 of file specctra.h.

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

3162  {
3163  delete parser;
3164  delete resolution;
3165  delete unit;
3166  delete structure;
3167  delete placement;
3168  delete library;
3169  delete network;
3170  delete wiring;
3171  }
UNIT_RES * resolution
Definition: specctra.h:3138
STRUCTURE * structure
Definition: specctra.h:3140
WIRING * wiring
Definition: specctra.h:3144
PARSER * parser
Definition: specctra.h:3137
LIBRARY * library
Definition: specctra.h:3142
PLACEMENT * placement
Definition: specctra.h:3141
UNIT_RES * unit
Definition: specctra.h:3139
NETWORK * network
Definition: specctra.h:3143

Member Function Documentation

void DSN::PCB::Format ( OUTPUTFORMATTER out,
int  nestLevel 
)
throw (IO_ERROR
)
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 3173 of file specctra.h.

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

Referenced by main().

3174  {
3175  const char* quote = out->GetQuoteChar( pcbname.c_str() );
3176 
3177  out->Print( nestLevel, "(%s %s%s%s\n", Name(),
3178  quote, pcbname.c_str(), quote );
3179 
3180  if( parser )
3181  parser->Format( out, nestLevel+1 );
3182 
3183  if( resolution )
3184  resolution->Format( out, nestLevel+1 );
3185 
3186  if( unit )
3187  unit->Format( out, nestLevel+1 );
3188 
3189  if( structure )
3190  structure->Format( out, nestLevel+1 );
3191 
3192  if( placement )
3193  placement->Format( out, nestLevel+1 );
3194 
3195  if( library )
3196  library->Format( out, nestLevel+1 );
3197 
3198  if( network )
3199  network->Format( out, nestLevel+1 );
3200 
3201  if( wiring )
3202  wiring->Format( out, nestLevel+1 );
3203 
3204  out->Print( nestLevel, ")\n" );
3205  }
UNIT_RES * resolution
Definition: specctra.h:3138
STRUCTURE * structure
Definition: specctra.h:3140
WIRING * wiring
Definition: specctra.h:3144
const char * Name() const
Definition: specctra.cpp:3497
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:3511
PARSER * parser
Definition: specctra.h:3137
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:331
LIBRARY * library
Definition: specctra.h:3142
PLACEMENT * placement
Definition: specctra.h:3141
UNIT_RES * unit
Definition: specctra.h:3139
int PRINTF_FUNC Print(int nestLevel, const char *fmt,...)
Function Print formats and writes text to the output stream.
Definition: richio.cpp:408
std::string pcbname
Definition: specctra.h:3136
NETWORK * network
Definition: specctra.h:3143
virtual void DSN::ELEM::FormatContents ( OUTPUTFORMATTER out,
int  nestLevel 
)
throw (IO_ERROR
)
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::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 3207 of file specctra.h.

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

3208  {
3209  if( unit )
3210  return unit;
3211 
3212  if( resolution )
3213  return resolution->GetUnits();
3214 
3215  return ELEM::GetUnits();
3216  }
virtual UNIT_RES * GetUnits() const
Function GetUnits returns the units for this section.
Definition: specctra.cpp:3502
UNIT_RES * resolution
Definition: specctra.h:3138
UNIT_RES * unit
Definition: specctra.h:3139
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:504
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 3134 of file specctra.h.

Member Data Documentation

LIBRARY* DSN::PCB::library
private

Definition at line 3142 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::MakePCB(), and ~PCB().

NETWORK* DSN::PCB::network
private

Definition at line 3143 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::exportNETCLASS(), DSN::SPECCTRA_DB::MakePCB(), and ~PCB().

ELEM* DSN::ELEM::parent
protectedinherited

Definition at line 200 of file specctra.h.

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

PARSER* DSN::PCB::parser
private

Definition at line 3137 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::MakePCB(), and ~PCB().

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

Definition at line 3136 of file specctra.h.

PLACEMENT* DSN::PCB::placement
private

Definition at line 3141 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::MakePCB(), and ~PCB().

UNIT_RES* DSN::PCB::resolution
private

Definition at line 3138 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::MakePCB(), and ~PCB().

STRING_FORMATTER DSN::ELEM::sf
staticprotectedinherited

Definition at line 222 of file specctra.h.

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

STRUCTURE* DSN::PCB::structure
private

Definition at line 3140 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::MakePCB(), and ~PCB().

DSN_T DSN::ELEM::type
protectedinherited

Definition at line 199 of file specctra.h.

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

UNIT_RES* DSN::PCB::unit
private

Definition at line 3139 of file specctra.h.

Referenced by GetUnits(), DSN::SPECCTRA_DB::MakePCB(), and ~PCB().

WIRING* DSN::PCB::wiring
private

Definition at line 3144 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::MakePCB(), and ~PCB().


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