30template<
class IntType>
39template<
class IntType>
48template<
class IntType>
64template<
class IntType>
65inline IntType Foam::OffsetRange<IntType>::at_value(IntType i)
const noexcept
67 return (start_ + ((i < 0 || i > size_) ? size_ : i));
71template<
class IntType>
78template<
class IntType>
81 return (start_ + size_);
85template<
class IntType>
88 return (start_ + (size_ - 1));
92template<
class IntType>
99template<
class IntType>
108template<
class IntType>
117template<
class IntType>
131template<
class IntType>
135 return (size_ && start_ <= value && (value - start_) < size_);
139template<
class IntType>
145 const auto& a = *
this;
149 a.start() ==
b.start()
150 && a.size() ==
b.size()
151 && a.total() ==
b.total()
156template<
class IntType>
162 const auto& a = *
this;
164 if (a.start() <
b.start())
return -1;
165 if (
b.start() < a.start())
return +1;
167 if (a.size() <
b.size())
return -1;
168 if (
b.size() < a.size())
return +1;
170 if (a.total() <
b.total())
return -1;
171 if (
b.total() < a.total())
return +1;
179template<
class IntType>
180inline constexpr IntType
A tuple of integers comprising start, size, total.
void clear() noexcept
Reset to zero.
constexpr IntType operator[](IntType i) const noexcept
Offset dereference, without bounds checking.
IntType rend_value() const noexcept
The value 1 before the begin of start/size range.
OffsetRange(const OffsetRange &) noexcept=default
Copy construct.
int compare(const OffsetRange &b) const noexcept
Compare start/size/total in that order.
bool equals(const OffsetRange &b) const noexcept
Test equality of start/size/total.
IntType rbegin_value() const noexcept
The max value of the start/size range.
constexpr OffsetRange() noexcept
Default construct as (0,0,0).
bool contains(IntType value) const noexcept
True if the value is between the start and size range range.
IntType begin_value() const noexcept
The value at the beginning of the start/size range - same as start().
IntType end_value() const noexcept
The value 1 beyond the end of the start/size range.
void reset(IntType len) noexcept
Reset to the specified size, with start=0 and total=size.