50 else if( aLayer ==
In1_Cu )
53 aLayer =
static_cast<int>( aLayer ) - 2;
63 else if( aLayer ==
F_Cu )
66 aLayer =
static_cast<int>( aLayer ) + 2;
82 if( start & 1 || stop & 1 )
83 throw std::invalid_argument(
"Only works for copper layers" );
120 if( start & 1 || stop & 1 )
121 throw std::invalid_argument(
"Only works for copper layers" );
133 static bool Contains(
int aStart_layer,
int aEnd_layer,
int aTest_layer )
138 if( aTest_layer ==
B_Cu )
139 aTest_layer = INT_MAX;
141 if( aStart_layer ==
B_Cu )
142 aStart_layer = INT_MAX;
144 if( aEnd_layer ==
B_Cu )
145 aEnd_layer = INT_MAX;
147 if( aStart_layer > aEnd_layer )
148 std::swap( aStart_layer, aEnd_layer );
150 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: