52#ifndef Foam_OffsetRange_H
53#define Foam_OffsetRange_H
81template<
class IntType>
84 static_assert(std::is_integral_v<IntType>,
"Integral required");
102 inline IntType at_value(IntType idx)
const noexcept;
182 IntRange<IntType>
range() const
noexcept {
return { start_, size_ }; }
214 void operator=(IntType len)
noexcept
223 class = std::enable_if_t
224 <std::is_integral_v<IntT2> && (
sizeof(IntT2) <=
sizeof(IntType))>
228 start_ =
rhs.start(); size_ =
rhs.size(); total_ =
rhs.total();
239 inline constexpr IntType
operator[](IntType i)
const noexcept;
249 inline bool contains(IntType value)
const noexcept;
302template<
class IntType>
303inline bool operator==
315template<
class IntType>
328template<
class IntType>
329inline bool operator!=
338template<
class IntType>
339inline bool operator<=
341 const OffsetRange<IntType>& a,
342 const OffsetRange<IntType>&
b
345 return (a.compare(
b) <= 0);
348template<
class IntType>
355 return (a.compare(
b) > 0);
358template<
class IntType>
359inline bool operator>=
365 return (a.compare(
b) >= 0);
A random-access, integer-like, input iterator for integral values.
An interval of (signed) integers defined by a start and a size.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
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.
const_iterator begin() const noexcept
A const_iterator set to the beginning of the range.
IntRange< IntType > range() const noexcept
The (state,size) range.
IntType rend_value() const noexcept
The value 1 before the begin of start/size range.
bool empty() const noexcept
True if zero-sized.
OffsetRange(const OffsetRange &) noexcept=default
Copy construct.
IndexIterator< IntType > const_iterator
Input iterator with const access.
int compare(const OffsetRange &b) const noexcept
Compare start/size/total in that order.
IntType & start() noexcept
Non-const access to start of the range.
IntType start() const noexcept
The lower value of the range.
bool equals(const OffsetRange &b) const noexcept
Test equality of start/size/total.
const_iterator end() const noexcept
A const_iterator set to 1 beyond the end of the range.
IntType size_type
The type that can represent the size.
IntType rbegin_value() const noexcept
The max value of the start/size range.
IntType size() const noexcept
The size.
ReverseIndexIterator< IntType > const_reverse_iterator
Reverse input iterator with const access.
constexpr OffsetRange() noexcept
Default construct as (0,0,0).
IntType total() const noexcept
The total size.
IntType & total() noexcept
Non-const access to the total size.
bool contains(IntType value) const noexcept
True if the value is between the start and size range range.
const_iterator cend() const noexcept
A const_iterator set to 1 beyond the end of the range.
bool operator()(IntType i) const noexcept
True if the value is between the start and size range.
OffsetRange(OffsetRange &&) noexcept=default
Move construct.
IntType & size() noexcept
Non-const access to the size.
IntType begin_value() const noexcept
The value at the beginning of the start/size range - same as start().
IntType value_type
Type of values contained.
const_reverse_iterator crbegin() const noexcept
A const_reverse_iterator set to 1 before the end of range.
const_iterator cbegin() const noexcept
A const_iterator set to the beginning of the range.
const_reverse_iterator rend() const noexcept
A const_reverse_iterator set to 1 before the begin of range.
const_reverse_iterator crend() const noexcept
A const_reverse_iterator set to 1 before the begin of range.
IntType end_value() const noexcept
The value 1 beyond the end of the start/size range.
const_iterator at(IntType i) const
Return const_iterator to a position within the range, with bounds checking.
void reset(IntType len) noexcept
Reset to the specified size, with start=0 and total=size.
const_reverse_iterator rbegin() const noexcept
A const_reverse_iterator set to 1 before the end of range.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A random-access, integer-like, input iterator for integral values that behaves like a reverse iterato...
limits reset(1/(limits.max()+VSMALL), 1/(limits.min()+VSMALL))
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Istream & operator>>(Istream &, directionInfo &)
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)