Horizon
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
LSET Class Reference

LSET is a set of PCB_LAYER_IDs. More...

#include <layer_ids.h>

Inheritance diagram for LSET:

Public Member Functions

 LSET ()
 Create an empty (cleared) set.
 
 LSET (const BASE_SET &aOther)
 
 LSET (PCB_LAYER_ID aLayer)
 Take a PCB_LAYER_ID and sets that bit.
 
 LSET (const PCB_LAYER_ID *aArray, unsigned aCount)
 Create an array or LSEQ.
 
 LSET (unsigned aIdCount, int aFirst,...)
 Take one or more PCB_LAYER_IDs in the argument list to construct the set.
 
bool Contains (PCB_LAYER_ID aLayer)
 See if the layer set contains a PCB layer.
 
LSEQ CuStack () const
 Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.
 
LSEQ Technicals (LSET aSubToOmit=LSET()) const
 Return a sequence of technical layers.
 
LSEQ Users () const
 *_User layers.
 
LSEQ TechAndUserUIOrder () const
 Returns the technical and user layers in the order shown in layer widget.
 
LSEQ UIOrder () const
 
LSEQ Seq (const PCB_LAYER_ID *aWishListSequence, unsigned aCount) const
 Return an LSEQ from the union of this LSET and a desired sequence.
 
LSEQ Seq () const
 Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.
 
LSEQ SeqStackupBottom2Top () const
 Return the sequence that is typical for a bottom-to-top stack-up.
 
std::string FmtHex () const
 Return a hex string showing contents of this LSEQ.
 
int ParseHex (const char *aStart, int aCount)
 Convert the output of FmtHex() and replaces this set's values with those given in the input string.
 
std::string FmtBin () const
 Return a binary string showing contents of this LSEQ.
 
PCB_LAYER_ID ExtractLayer () const
 Find the first set PCB_LAYER_ID.
 

Static Public Member Functions

static const wxChar * Name (PCB_LAYER_ID aLayerId)
 Return the fixed name association with aLayerId.
 
static LSET InternalCuMask ()
 Return a complete set of internal copper layers which is all Cu layers except F_Cu and B_Cu.
 
static LSET FrontAssembly ()
 Return a complete set of all top assembly layers which is all F_SilkS and F_Mask.
 
static LSET BackAssembly ()
 Return a complete set of all bottom assembly layers which is all B_SilkS and B_Mask.
 
static LSET AllCuMask (int aCuLayerCount=MAX_CU_LAYERS)
 Return a mask holding the requested number of Cu PCB_LAYER_IDs.
 
static LSET ExternalCuMask ()
 Return a mask holding the Front and Bottom layers.
 
static LSET AllNonCuMask ()
 Return a mask holding all layer minus CU layers.
 
static LSET AllLayersMask ()
 
static LSET FrontTechMask ()
 Return a mask holding all technical layers (no CU layer) on front side.
 
static LSET FrontBoardTechMask ()
 Return a mask holding technical layers used in a board fabrication (no CU layer) on front side.
 
static LSET BackTechMask ()
 Return a mask holding all technical layers (no CU layer) on back side.
 
static LSET BackBoardTechMask ()
 Return a mask holding technical layers used in a board fabrication (no CU layer) on Back side.
 
static LSET AllTechMask ()
 Return a mask holding all technical layers (no CU layer) on both side.
 
static LSET AllBoardTechMask ()
 Return a mask holding board technical layers (no CU layer) on both side.
 
static LSET FrontMask ()
 Return a mask holding all technical layers and the external CU layer on front side.
 
static LSET BackMask ()
 Return a mask holding all technical layers and the external CU layer on back side.
 
static LSET UserMask ()
 
static LSET PhysicalLayersMask ()
 Return a mask holding all layers which are physically realized.
 
static LSET UserDefinedLayers ()
 Return a mask with all of the allowable user defined layers.
 
static LSET ForbiddenFootprintLayers ()
 Layers which are not allowed within footprint definitions.
 

Detailed Description

LSET is a set of PCB_LAYER_IDs.

It can be converted to numerous purpose LSEQs using the various member functions, most of which are based on Seq(). The advantage of converting to LSEQ using purposeful code, is it removes any dependency on order/sequence inherent in this set.

Constructor & Destructor Documentation

◆ LSET() [1/2]

LSET::LSET ( PCB_LAYER_ID  aLayer)
inline

Take a PCB_LAYER_ID and sets that bit.

This makes the following code into a bug:

LSET s = 0;

Instead use:

LSET s;

for an empty set.

◆ LSET() [2/2]

LSET::LSET ( unsigned  aIdCount,
int  aFirst,
  ... 
)

Take one or more PCB_LAYER_IDs in the argument list to construct the set.

Typically only used in static construction.

Parameters
aIdCountis the number of PCB_LAYER_IDs which follow.
aFirstis the first included in aIdCount and must always be present, and can be followed by any number of additional PCB_LAYER_IDs so long as aIdCount accurately reflects the count.

Parameter is 'int' to avoid va_start undefined behavior.

Member Function Documentation

◆ Contains()

bool LSET::Contains ( PCB_LAYER_ID  aLayer)
inline

See if the layer set contains a PCB layer.

Parameters
aLayeris the layer to check
Returns
true if the layer is included

◆ CuStack()

LSEQ LSET::CuStack ( ) const

Return a sequence of copper layers in starting from the front/top and extending to the back/bottom.

This specific sequence is depended upon in numerous places.

◆ ExtractLayer()

PCB_LAYER_ID LSET::ExtractLayer ( ) const

Find the first set PCB_LAYER_ID.

Returns UNDEFINED_LAYER if more than one is set or UNSELECTED_LAYER if none is set.

◆ ForbiddenFootprintLayers()

static LSET LSET::ForbiddenFootprintLayers ( )
static

Layers which are not allowed within footprint definitions.

Currently internal copper layers and Margin.

◆ ParseHex()

int LSET::ParseHex ( const char *  aStart,
int  aCount 
)

Convert the output of FmtHex() and replaces this set's values with those given in the input string.

Parsing stops at the first non hex ASCII byte, except that marker bytes output from FmtHex are not terminators.

Returns
int - number of bytes consumed

◆ PhysicalLayersMask()

static LSET LSET::PhysicalLayersMask ( )
static

Return a mask holding all layers which are physically realized.

Equivalent to the copper layers + the board tech mask.

◆ Seq() [1/2]

LSEQ LSET::Seq ( ) const

Return a LSEQ from this LSET in ascending PCB_LAYER_ID order.

Each LSEQ element will be in the same sequence as in PCB_LAYER_ID and only present in the resultant LSEQ if present in this set. Therefore the sequence is subject to change, use it only when enumeration and not order is important.

◆ Seq() [2/2]

LSEQ LSET::Seq ( const PCB_LAYER_ID *  aWishListSequence,
unsigned  aCount 
) const

Return an LSEQ from the union of this LSET and a desired sequence.

The LSEQ element will be in the same sequence as aWishListSequence if they are present.

Parameters
aWishListSequenceestablishes the order of the returned LSEQ, and the LSEQ will only contain PCB_LAYER_IDs which are present in this set.
aCountis the length of aWishListSequence array.

◆ SeqStackupBottom2Top()

LSEQ LSET::SeqStackupBottom2Top ( ) const

Return the sequence that is typical for a bottom-to-top stack-up.

For instance, to plot multiple layers in a single image, the top layers output last.

◆ Technicals()

LSEQ LSET::Technicals ( LSET  aSubToOmit = LSET()) const

Return a sequence of technical layers.

A sequence provides a certain order.

Parameters
aSubToOmitis the subset of the technical layers to omit, defaults to none.

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