49 else if( aLayer ==
In1_Cu )
52 aLayer =
static_cast<int>( aLayer ) - 2;
62 else if( aLayer ==
F_Cu )
65 aLayer =
static_cast<int>( aLayer ) + 2;
81 if( start & 1 || stop & 1 )
82 throw std::invalid_argument(
"Only works for copper layers" );
119 if( start & 1 || stop & 1 )
120 throw std::invalid_argument(
"Only works for copper layers" );
130 static bool Contains(
int aStart_layer,
int aEnd_layer,
int aTest_layer )
135 if( aTest_layer ==
B_Cu )
136 aTest_layer = INT_MAX;
138 if( aStart_layer ==
B_Cu )
139 aStart_layer = INT_MAX;
141 if( aEnd_layer ==
B_Cu )
142 aEnd_layer = INT_MAX;
144 if( aStart_layer > aEnd_layer )
145 std::swap( aStart_layer, aEnd_layer );
147 return aTest_layer >= aStart_layer && aTest_layer <= aEnd_layer;
PCB_LAYER_ID operator*() const
bool operator==(const LAYER_RANGE_ITERATOR &other) const
LAYER_RANGE_ITERATOR operator++(int)
bool operator!=(const LAYER_RANGE_ITERATOR &other) const
LAYER_RANGE_ITERATOR & operator++()
int next_layer(int aLayer)
std::bidirectional_iterator_tag iterator_category
std::ptrdiff_t difference_type
LAYER_RANGE_ITERATOR(PCB_LAYER_ID start, PCB_LAYER_ID stop, int layer_count)
static bool Contains(int aStart_layer, int aEnd_layer, int aTest_layer)
LAYER_RANGE_ITERATOR end() const
LAYER_RANGE_ITERATOR begin() const
LAYER_RANGE(PCB_LAYER_ID start, PCB_LAYER_ID stop, int layer_count)
bool Contains(int aTest_layer)
PCB_LAYER_ID
A quick note on layer IDs: