4 range
range::make_b(uint32_t l
, uint32_t h
)
9 range::range(uint32_t l
, uint32_t h
)
15 range
& range::operator+=(uint32_t o
) throw()
23 range
& range::operator&=(const range
& b
) throw()
26 uint32_t offset
= _low
;
27 uint32_t L
= _high
- _low
;
28 uint32_t A
= b
._low
- _low
;
29 uint32_t B
= b
._high
- _low
;
31 bool asl
= (A
< L
); //There is initial overlap between ranges.
32 bool asb
= (A
<= B
); //Range 2 does not warp around.
34 //If there is initial overlap, the range bottom is A+offset, otherwise 0+offset.
35 _low
= offset
+ (asl
? A
: 0);
36 //If asl EQU asb, then range top is min(L, B). Otherwise if asl, it is L, otherwise 0.
37 _high
= offset
+ ((asl
== asb
) ? min(L
, B
) : (asl
? L
: 0));
42 bool range::in(uint32_t x
) const throw()
44 return ((x
- _low
) < (_high
- _low
));