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

A <library_descriptor> in the specctra dsn specification. More...

#include <specctra.h>

Inheritance diagram for DSN::LIBRARY:
DSN::ELEM

Public Member Functions

 LIBRARY (ELEM *aParent, DSN_T aType=T_library)
 
 ~LIBRARY ()
 
void AddPadstack (PADSTACK *aPadstack)
 
int FindIMAGE (IMAGE *aImage)
 Search this LIBRARY for an image which matches the argument.
 
void AppendIMAGE (IMAGE *aImage)
 Add the image to the image list.
 
IMAGELookupIMAGE (IMAGE *aImage)
 Add the image only if one exactly like it does not already exist in the image container.
 
int FindVia (PADSTACK *aVia)
 Search this LIBRARY for a via which matches the argument.
 
void AppendVia (PADSTACK *aVia)
 Add aVia to the internal via container.
 
void AppendPADSTACK (PADSTACK *aPadstack)
 Add the padstack to the padstack container.
 
PADSTACKLookupVia (PADSTACK *aVia)
 Add the via only if one exactly like it does not already exist in the padstack container.
 
PADSTACKFindPADSTACK (const std::string &aPadstackId)
 Search the padstack container by name.
 
void FormatContents (OUTPUTFORMATTER *out, int nestLevel) override
 Write the contents as ASCII out to an OUTPUTFORMATTER according to the SPECCTRA DSN format.
 
UNIT_RESGetUnits () const override
 Return the units for this section.
 
DSN_T Type () const
 
const char * Name () const
 
virtual void Format (OUTPUTFORMATTER *out, int nestLevel)
 Write this object 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
 

Private Attributes

UNIT_RESm_unit
 
boost::ptr_vector< IMAGEm_images
 
boost::ptr_vector< PADSTACKm_padstacks
 all except vias, which are in 'vias'
 
boost::ptr_vector< PADSTACKm_vias
 

Friends

class SPECCTRA_DB
 

Detailed Description

A <library_descriptor> in the specctra dsn specification.

Only unit_descriptor, image_descriptors, and padstack_descriptors are included as children at this time.

Definition at line 2226 of file specctra.h.

Constructor & Destructor Documentation

◆ LIBRARY()

DSN::LIBRARY::LIBRARY ( ELEM * aParent,
DSN_T aType = T_library )
inline

Definition at line 2229 of file specctra.h.

References DSN::ELEM::ELEM(), and m_unit.

◆ ~LIBRARY()

DSN::LIBRARY::~LIBRARY ( )
inline

Definition at line 2236 of file specctra.h.

References m_unit.

Member Function Documentation

◆ AddPadstack()

void DSN::LIBRARY::AddPadstack ( PADSTACK * aPadstack)
inline

Definition at line 2241 of file specctra.h.

References m_padstacks, and DSN::ELEM::SetParent().

Referenced by DSN::SPECCTRA_DB::doLIBRARY().

◆ AppendIMAGE()

void DSN::LIBRARY::AppendIMAGE ( IMAGE * aImage)
inline

Add the image to the image list.

Definition at line 2290 of file specctra.h.

References m_images, and DSN::ELEM::SetParent().

Referenced by LookupIMAGE().

◆ AppendPADSTACK()

void DSN::LIBRARY::AppendPADSTACK ( PADSTACK * aPadstack)
inline

Add the padstack to the padstack container.

Definition at line 2344 of file specctra.h.

References m_padstacks, and DSN::ELEM::SetParent().

◆ AppendVia()

void DSN::LIBRARY::AppendVia ( PADSTACK * aVia)
inline

Add aVia to the internal via container.

Definition at line 2334 of file specctra.h.

References m_vias, and DSN::ELEM::SetParent().

Referenced by LookupVia().

◆ FindIMAGE()

int DSN::LIBRARY::FindIMAGE ( IMAGE * aImage)
inline

Search this LIBRARY for an image which matches the argument.

Returns
index of image if found, else -1.

Definition at line 2263 of file specctra.h.

References DSN::IMAGE::Compare(), image, DSN::IMAGE::m_duplicated, DSN::IMAGE::m_image_id, and m_images.

Referenced by LookupIMAGE().

◆ FindPADSTACK()

PADSTACK * DSN::LIBRARY::FindPADSTACK ( const std::string & aPadstackId)
inline

Search the padstack container by name.

Returns
The PADSTACK with a matching name if it exists, else nullptr.

Definition at line 2374 of file specctra.h.

References m_padstacks.

◆ FindVia()

int DSN::LIBRARY::FindVia ( PADSTACK * aVia)
inline

Search this LIBRARY for a via which matches the argument.

Returns
the index found in the padstack list, else -1.

Definition at line 2320 of file specctra.h.

References DSN::PADSTACK::Compare(), and m_vias.

Referenced by LookupVia().

◆ Format()

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

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

void DSN::LIBRARY::FormatContents ( OUTPUTFORMATTER * out,
int nestLevel )
inlineoverridevirtual

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 from DSN::ELEM.

Definition at line 2385 of file specctra.h.

References image, m_images, m_padstacks, m_unit, m_vias, and via.

◆ GetUnits()

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

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 from DSN::ELEM.

Definition at line 2400 of file specctra.h.

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

◆ LookupIMAGE()

IMAGE * DSN::LIBRARY::LookupIMAGE ( IMAGE * aImage)
inline

Add the image only if one exactly like it does not already exist in the image container.

Returns
the IMAGE which is registered in the LIBRARY that matches the argument, and it will be either the argument or a previous image which is a duplicate.

Definition at line 2302 of file specctra.h.

References AppendIMAGE(), FindIMAGE(), and m_images.

◆ LookupVia()

PADSTACK * DSN::LIBRARY::LookupVia ( PADSTACK * aVia)
inline

Add the via only if one exactly like it does not already exist in the padstack container.

Returns
the PADSTACK which is registered in the LIBRARY that matches the argument, and it will be either the argument or a previous padstack which is a duplicate.

Definition at line 2356 of file specctra.h.

References AppendVia(), FindVia(), and m_vias.

◆ makeHash()

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

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

References SPECCTRA_DB.

Referenced by SPECCTRA_DB.

Member Data Documentation

◆ m_images

boost::ptr_vector<IMAGE> DSN::LIBRARY::m_images
private

◆ m_padstacks

boost::ptr_vector<PADSTACK> DSN::LIBRARY::m_padstacks
private

all except vias, which are in 'vias'

Definition at line 2414 of file specctra.h.

Referenced by AddPadstack(), AppendPADSTACK(), FindPADSTACK(), and FormatContents().

◆ m_unit

UNIT_RES* DSN::LIBRARY::m_unit
private

Definition at line 2411 of file specctra.h.

Referenced by DSN::SPECCTRA_DB::doLIBRARY(), FormatContents(), GetUnits(), LIBRARY(), and ~LIBRARY().

◆ m_vias

boost::ptr_vector<PADSTACK> DSN::LIBRARY::m_vias
private

Definition at line 2415 of file specctra.h.

Referenced by AppendVia(), FindVia(), FormatContents(), and LookupVia().

◆ parent

ELEM* DSN::ELEM::parent
protectedinherited

Definition at line 279 of file specctra.h.

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

◆ sf

STRING_FORMATTER DSN::ELEM::sf
staticprotectedinherited

Definition at line 276 of file specctra.h.

Referenced by makeHash().

◆ type

DSN_T DSN::ELEM::type
protectedinherited

Definition at line 278 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 file: