30template<
class IntType>
38template<
class IntType>
46template<
class IntType>
60template<
class IntType>
61inline IntType Foam::IntRange<IntType>::at_value(IntType i)
const noexcept
63 return (start_ + ((i < 0 || i > size_) ? size_ : i));
67template<
class IntType>
74template<
class IntType>
77 return (start_ + size_);
81template<
class IntType>
84 return (start_ + (size_ - 1));
88template<
class IntType>
97template<
class IntType>
105template<
class IntType>
113template<
class IntType>
121template<
class IntType>
128template<
class IntType>
135template<
class IntType>
142template<
class IntType>
145 if (size_ < 0) size_ = 0;
149template<
class IntType>
154 return (size_ && start_ <= value && (value - start_) < size_);
160template<
class IntType>
168template<
class IntType>
176template<
class IntType>
184template<
class IntType>
188 if (size_ > 0) --size_;
193template<
class IntType>
198 if (size_ > 0) --size_;
203template<
class IntType>
212template<
class IntType>
217 if (size_ <= 0) size_ = 0;
void clear() noexcept
Reset to (0,0).
IntType operator+=(IntType n) noexcept
Increase the size by n.
IntType operator++() noexcept
Increase the size by 1.
constexpr IntType operator[](IntType i) const noexcept
Offset dereference, without bounds checking.
void reset() noexcept
Reset to (0,0).
IntType operator--() noexcept
Decrease the size by 1, but never below 0.
IntType rend_value() const noexcept
The value 1 before the begin of range.
void setStart(IntType i) noexcept
Set the start position, no checks.
IntType rbegin_value() const noexcept
The max value of the range.
void resize(IntType n) noexcept
Change the size, no checks. Identical to setSize().
void clampSize() noexcept
Enforce non-negative size.
bool contains(IntType value) const noexcept
True if the (global) value is within the range.
IntType begin_value() const noexcept
The value at the beginning of the range - same as min(), start().
constexpr IntRange() noexcept
Default construct an empty range (0,0).
IntType end_value() const noexcept
The value 1 beyond the end of the range.
IntType operator-=(IntType n) noexcept
Decrease the size by n, but never below 0.
void setSize(IntType n) noexcept
Change the size, no checks. Identical to resize().