KiCad PCB EDA Suite
LSEQ Class Reference

LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs. More...

#include <layers_id_colors_and_visibility.h>

Inheritance diagram for LSEQ:

Public Member Functions

 LSEQ ()
 
template<class InputIterator >
 LSEQ (InputIterator aStart, InputIterator aEnd)
 
void Rewind ()
 
void operator++ ()
 
void operator++ (int)
 
 operator bool ()
 
PCB_LAYER_ID operator * () const
 

Private Attributes

unsigned m_index
 

Detailed Description

LSEQ is a sequence (and therefore also a set) of PCB_LAYER_IDs.

A sequence provides a certain order.

It can also be used as an iterator:

 for( LSEQ cu_stack = aSet.CuStack();  cu_stack;  ++cu_stack )
 {
     layer_id = *cu_stack;
     :
     things to do with layer_id;
 }

Definition at line 378 of file layers_id_colors_and_visibility.h.

Constructor & Destructor Documentation

◆ LSEQ() [1/2]

LSEQ::LSEQ ( )
inline

Definition at line 384 of file layers_id_colors_and_visibility.h.

384  :
385  m_index( 0 )
386  {}

◆ LSEQ() [2/2]

template<class InputIterator >
LSEQ::LSEQ ( InputIterator  aStart,
InputIterator  aEnd 
)
inline

Definition at line 389 of file layers_id_colors_and_visibility.h.

389  :
390  BASE_SEQ( aStart, aEnd ), m_index( 0 )
391  {}
std::vector< PCB_LAYER_ID > BASE_SEQ
A sequence of layers, a sequence provides a certain order.

Member Function Documentation

◆ operator *()

PCB_LAYER_ID LSEQ::operator * ( ) const
inline

Definition at line 401 of file layers_id_colors_and_visibility.h.

402  {
403  return at( m_index ); // throws std::out_of_range
404  }

References m_index.

◆ operator bool()

LSEQ::operator bool ( )
inline

Definition at line 399 of file layers_id_colors_and_visibility.h.

399 { return m_index < size(); }

References m_index.

◆ operator++() [1/2]

void LSEQ::operator++ ( )
inline

Definition at line 395 of file layers_id_colors_and_visibility.h.

395 { ++m_index; } // returns nothing, used in simple statements only.

References m_index.

◆ operator++() [2/2]

void LSEQ::operator++ ( int  )
inline

Definition at line 397 of file layers_id_colors_and_visibility.h.

397 { ++m_index; }

References m_index.

◆ Rewind()

void LSEQ::Rewind ( )
inline

Definition at line 393 of file layers_id_colors_and_visibility.h.

393 { m_index = 0; }

References m_index.

Member Data Documentation

◆ m_index

unsigned LSEQ::m_index
private

Definition at line 380 of file layers_id_colors_and_visibility.h.

Referenced by operator *(), operator bool(), operator++(), and Rewind().


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