KiCad PCB EDA Suite
LAYER_RANGE Class Reference

Represent a contiguous set of PCB layers. More...

#include <pns_layerset.h>

Public Member Functions

 LAYER_RANGE ()
 
 LAYER_RANGE (int aStart, int aEnd)
 
 LAYER_RANGE (int aLayer)
 
 LAYER_RANGE (const LAYER_RANGE &aB)
 
 ~LAYER_RANGE ()
 
LAYER_RANGEoperator= (const LAYER_RANGE &aB)
 
bool Overlaps (const LAYER_RANGE &aOther) const
 
bool Overlaps (const int aLayer) const
 
bool IsMultilayer () const
 
int Start () const
 
int End () const
 
void Merge (const LAYER_RANGE &aOther)
 Shortcut for comparisons/overlap tests. More...
 
bool operator== (const LAYER_RANGE &aOther) const
 
bool operator!= (const LAYER_RANGE &aOther) const
 

Static Public Member Functions

static LAYER_RANGE All ()
 

Private Attributes

int m_start
 
int m_end
 

Detailed Description

Represent a contiguous set of PCB layers.

Definition at line 31 of file pns_layerset.h.

Constructor & Destructor Documentation

◆ LAYER_RANGE() [1/4]

LAYER_RANGE::LAYER_RANGE ( )
inline

Definition at line 34 of file pns_layerset.h.

34  :
35  m_start( -1 ),
36  m_end( -1 )
37  {};

Referenced by All().

◆ LAYER_RANGE() [2/4]

LAYER_RANGE::LAYER_RANGE ( int  aStart,
int  aEnd 
)
inline

Definition at line 39 of file pns_layerset.h.

40  {
41  if( aStart > aEnd )
42  std::swap( aStart, aEnd );
43 
44  m_start = aStart;
45  m_end = aEnd;
46  }

References m_end, and m_start.

◆ LAYER_RANGE() [3/4]

LAYER_RANGE::LAYER_RANGE ( int  aLayer)
inline

Definition at line 48 of file pns_layerset.h.

49  {
50  m_start = m_end = aLayer;
51  }

References m_end, and m_start.

◆ LAYER_RANGE() [4/4]

LAYER_RANGE::LAYER_RANGE ( const LAYER_RANGE aB)
inline

Definition at line 53 of file pns_layerset.h.

53  :
54  m_start( aB.m_start ),
55  m_end( aB.m_end )
56  {}

◆ ~LAYER_RANGE()

LAYER_RANGE::~LAYER_RANGE ( )
inline

Definition at line 58 of file pns_layerset.h.

58 {};

Member Function Documentation

◆ All()

static LAYER_RANGE LAYER_RANGE::All ( )
inlinestatic

Definition at line 109 of file pns_layerset.h.

110  {
111  return LAYER_RANGE( 0, 256 ); // fixme: use layer IDs header
112  }

References LAYER_RANGE().

Referenced by PNS::ROUTER::QueryHoverItems().

◆ End()

◆ IsMultilayer()

◆ Merge()

void LAYER_RANGE::Merge ( const LAYER_RANGE aOther)
inline

Shortcut for comparisons/overlap tests.

Definition at line 92 of file pns_layerset.h.

References m_end, and m_start.

Referenced by PNS::JOINT::Merge().

◆ operator!=()

bool LAYER_RANGE::operator!= ( const LAYER_RANGE aOther) const
inline

Definition at line 119 of file pns_layerset.h.

120  {
121  return ( m_start != aOther.m_start ) || ( m_end != aOther.m_end );
122  }

References m_end, and m_start.

◆ operator=()

LAYER_RANGE& LAYER_RANGE::operator= ( const LAYER_RANGE aB)
inline

Definition at line 60 of file pns_layerset.h.

61  {
62  m_start = aB.m_start;
63  m_end = aB.m_end;
64  return *this;
65  }

References m_end, and m_start.

◆ operator==()

bool LAYER_RANGE::operator== ( const LAYER_RANGE aOther) const
inline

Definition at line 114 of file pns_layerset.h.

115  {
116  return ( m_start == aOther.m_start ) && ( m_end == aOther.m_end );
117  }

References m_end, and m_start.

◆ Overlaps() [1/2]

◆ Overlaps() [2/2]

bool LAYER_RANGE::Overlaps ( const int  aLayer) const
inline

Definition at line 72 of file pns_layerset.h.

73  {
74  return aLayer >= m_start && aLayer <= m_end;
75  }

References m_end, and m_start.

◆ Start()

Member Data Documentation

◆ m_end

int LAYER_RANGE::m_end
private

◆ m_start

int LAYER_RANGE::m_start
private

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