An interval of (signed) integers defined by a start and a size. More...
Classes | |
class | const_iterator |
Random-access input iterator with const access. More... | |
class | const_reverse_iterator |
Random-access reverse input iterator with const access. More... | |
struct | ge0 |
Unary predicate for greater-equal 0 (int values) More... | |
struct | gt0 |
Unary predicate for greater than 0 (int values) More... | |
struct | le0 |
Unary predicate for less-equal 0 (int values) More... | |
struct | lt0 |
Unary predicate for less than 0 (int values) More... | |
Public Types | |
typedef IntType | value_type |
Type of values the range contains. More... | |
typedef IntType | size_type |
The type that can represent the size of the range. More... | |
Public Member Functions | |
constexpr | IntRange () noexcept |
Default construct an empty range (0,0) More... | |
constexpr | IntRange (const IntType len) noexcept |
Construct a range with specified length, starting at zero (0,len) More... | |
constexpr | IntRange (const IntType beg, const IntType len) noexcept |
Construct a range from start/length, no checks. More... | |
bool | empty () const noexcept |
True if range is empty (zero-sized) More... | |
bool | good () const noexcept |
True if range has size greater than zero. More... | |
IntType | size () const noexcept |
The size of the range. More... | |
IntType & | size () noexcept |
Non-const access to size of the range. More... | |
IntType | start () const noexcept |
The (inclusive) lower value of the range. More... | |
IntType & | start () noexcept |
Non-const access to start of the range. More... | |
IntType | min () const noexcept |
The (inclusive) lower value of the range, same as start(), begin_value() More... | |
IntType | max () const noexcept |
The (inclusive) upper value of the range, same as rbegin_value(). Ill-defined for an empty range. More... | |
void | reset () noexcept |
Reset to zero start and zero size. More... | |
void | reset (const IntType beg, const IntType len) noexcept |
Reset start and length, no checks. More... | |
void | clear () noexcept |
Same as reset() - reset to zero start and zero size. More... | |
void | setStart (const IntType i) noexcept |
Set the start position, no checks. More... | |
void | setSize (const IntType n) noexcept |
Change the size, no checks. Identical to resize() More... | |
void | resize (const IntType n) noexcept |
Change the size, no checks. Identical to setSize() More... | |
void | clampSize () noexcept |
Enforce non-negative size. More... | |
bool | contains (const IntType value) const noexcept |
True if the (global) value is within the range. More... | |
bool | found (const IntType val) const noexcept |
True if the (global) value is within the range. More... | |
const_iterator | at (const IntType i) const |
Return const_iterator to a position within the range, with bounds checking. More... | |
constexpr IntType | operator[] (const IntType i) const noexcept |
Offset dereference, without bounds checking. More... | |
bool | operator() (const IntType i) const noexcept |
True if the global value is located within the range. More... | |
IntType | operator++ () noexcept |
Increase the size by 1. More... | |
IntType | operator++ (int) noexcept |
IntType | operator+= (const IntType n) noexcept |
Increase the size by n. More... | |
IntType | operator-- () noexcept |
Decrease the size by 1, but never below 0. More... | |
IntType | operator-- (int) noexcept |
IntType | operator-= (const IntType n) noexcept |
Decrease the size by n, but never below 0. More... | |
operator bool () const noexcept | |
True if range has size greater than zero. Same as good() More... | |
IntType | begin_value () const noexcept |
The value at the beginning of the range - same as min(), start() More... | |
IntType | end_value () const noexcept |
The value 1 beyond the end of the range. More... | |
IntType | rbegin_value () const noexcept |
The max value of the range. More... | |
IntType | rend_value () const noexcept |
The value 1 before the begin of range. More... | |
const_iterator | begin () const noexcept |
A const_iterator set to the beginning of the range. More... | |
const_iterator | cbegin () const noexcept |
A const_iterator set to the beginning of the range. More... | |
const_iterator | cend () const noexcept |
A const_iterator set to 1 beyond the end of the range. More... | |
const_iterator | end () const noexcept |
A const_iterator set to 1 beyond the end of the range. More... | |
const_reverse_iterator | rbegin () const noexcept |
A const_reverse_iterator set to 1 before the end of range. More... | |
const_reverse_iterator | crbegin () const noexcept |
A const_reverse_iterator set to 1 before the end of range. More... | |
const_reverse_iterator | rend () const noexcept |
A const_reverse_iterator set to 1 before the begin of range. More... | |
const_reverse_iterator | crend () const noexcept |
A const_reverse_iterator set to 1 before the begin of range. More... | |
An interval of (signed) integers defined by a start and a size.
Definition at line 59 of file IntRange.H.
typedef IntType value_type |
Type of values the range contains.
Definition at line 83 of file IntRange.H.
typedef IntType size_type |
The type that can represent the size of the range.
Definition at line 88 of file IntRange.H.
|
inlinenoexcept |
Default construct an empty range (0,0)
Definition at line 24 of file IntRangeI.H.
|
inlineexplicitnoexcept |
Construct a range with specified length, starting at zero (0,len)
Definition at line 33 of file IntRangeI.H.
|
inlinenoexcept |
Construct a range from start/length, no checks.
Definition at line 44 of file IntRangeI.H.
|
inlinenoexcept |
True if range is empty (zero-sized)
Definition at line 184 of file IntRange.H.
Referenced by Foam::BitOps::set(), bitSet::set(), ensightFaces::sort(), ensightCells::sort(), and bitSet::unset().
|
inlinenoexcept |
True if range has size greater than zero.
Definition at line 189 of file IntRange.H.
|
inlinenoexcept |
The size of the range.
Definition at line 194 of file IntRange.H.
Referenced by UPstream::allocateCommunicator(), triSurfaceMesh::edgeTree(), ITstream::find(), Foam::operator<(), Foam::operator==(), cyclicAMIGAMGInterfaceField::ready(), cyclicACMIGAMGInterfaceField::ready(), mapDistributeBase::receive(), SubList< Type >::reset(), and mapDistributeBase::send().
|
inlinenoexcept |
Non-const access to size of the range.
Definition at line 199 of file IntRange.H.
|
inlinenoexcept |
The (inclusive) lower value of the range.
Definition at line 204 of file IntRange.H.
Referenced by globalIndex::calcRange(), ensightFaces::classify(), ITstream::find(), Foam::operator<(), Foam::operator==(), cyclicAMIGAMGInterfaceField::ready(), cyclicACMIGAMGInterfaceField::ready(), mapDistributeBase::receive(), SubList< Type >::reset(), and mapDistributeBase::send().
|
inlinenoexcept |
Non-const access to start of the range.
Definition at line 209 of file IntRange.H.
|
inlinenoexcept |
The (inclusive) lower value of the range, same as start(), begin_value()
Definition at line 215 of file IntRange.H.
Referenced by labelRange::join(), labelRange::overlaps(), labelRanges::remove(), and labelRange::subset().
|
inlinenoexcept |
The (inclusive) upper value of the range, same as rbegin_value(). Ill-defined for an empty range.
Definition at line 221 of file IntRange.H.
Referenced by labelRange::join(), labelRange::overlaps(), labelRanges::remove(), and labelRange::subset().
|
inlinenoexcept |
Reset to zero start and zero size.
Definition at line 397 of file IntRangeI.H.
Referenced by IntRange< label >::clear().
|
inlinenoexcept |
Reset start and length, no checks.
Definition at line 405 of file IntRangeI.H.
|
inlinenoexcept |
Same as reset() - reset to zero start and zero size.
Definition at line 239 of file IntRange.H.
Referenced by cyclicAMIGAMGInterfaceField::ready(), and cyclicACMIGAMGInterfaceField::ready().
|
inlinenoexcept |
Set the start position, no checks.
Definition at line 416 of file IntRangeI.H.
|
inlinenoexcept |
Change the size, no checks. Identical to resize()
Definition at line 423 of file IntRangeI.H.
|
inlinenoexcept |
Change the size, no checks. Identical to setSize()
Definition at line 430 of file IntRangeI.H.
|
inlinenoexcept |
Enforce non-negative size.
Definition at line 437 of file IntRangeI.H.
Referenced by labelRange::join(), IntRange< label >::operator--(), IntRange< label >::operator-=(), and labelRanges::remove().
|
inlinenoexcept |
True if the (global) value is within the range.
Definition at line 444 of file IntRangeI.H.
Referenced by IntRange< label >::found(), decomposedBlockData::gatherSlaveData(), and IntRange< label >::operator()().
|
inlinenoexcept |
True if the (global) value is within the range.
Definition at line 272 of file IntRange.H.
|
inline |
Return const_iterator to a position within the range, with bounds checking.
Definition at line 324 of file IntRangeI.H.
|
inlinenoexcept |
Offset dereference, without bounds checking.
Definition at line 458 of file IntRangeI.H.
|
inlinenoexcept |
True if the global value is located within the range.
Behaviour identical to contains() - usable as a predicate
Definition at line 296 of file IntRange.H.
|
inlinenoexcept |
Increase the size by 1.
Definition at line 466 of file IntRangeI.H.
|
inlinenoexcept |
Definition at line 474 of file IntRangeI.H.
|
inlinenoexcept |
Increase the size by n.
Definition at line 503 of file IntRangeI.H.
|
inlinenoexcept |
Decrease the size by 1, but never below 0.
Definition at line 482 of file IntRangeI.H.
|
inlinenoexcept |
Definition at line 492 of file IntRangeI.H.
|
inlinenoexcept |
Decrease the size by n, but never below 0.
Definition at line 512 of file IntRangeI.H.
|
inlineexplicitnoexcept |
True if range has size greater than zero. Same as good()
Definition at line 323 of file IntRange.H.
|
inlinenoexcept |
The value at the beginning of the range - same as min(), start()
Definition at line 57 of file IntRangeI.H.
Referenced by IntRange< label >::begin(), IntRange< label >::cbegin(), bitSet::set(), and bitSet::unset().
|
inlinenoexcept |
The value 1 beyond the end of the range.
Definition at line 64 of file IntRangeI.H.
Referenced by IntRange< label >::cend(), IntRange< label >::end(), decomposedBlockData::gatherSlaveData(), Foam::BitOps::set(), bitSet::set(), and bitSet::unset().
|
inlinenoexcept |
The max value of the range.
Definition at line 71 of file IntRangeI.H.
Referenced by IntRange< label >::crbegin(), and IntRange< label >::rbegin().
|
inlinenoexcept |
The value 1 before the begin of range.
Definition at line 78 of file IntRangeI.H.
Referenced by IntRange< label >::crend(), and IntRange< label >::rend().
|
inlinenoexcept |
A const_iterator set to the beginning of the range.
Definition at line 332 of file IntRangeI.H.
|
inlinenoexcept |
A const_iterator set to the beginning of the range.
Definition at line 340 of file IntRangeI.H.
|
inlinenoexcept |
A const_iterator set to 1 beyond the end of the range.
Definition at line 356 of file IntRangeI.H.
|
inlinenoexcept |
A const_iterator set to 1 beyond the end of the range.
Definition at line 348 of file IntRangeI.H.
|
inlinenoexcept |
A const_reverse_iterator set to 1 before the end of range.
Definition at line 364 of file IntRangeI.H.
|
inlinenoexcept |
A const_reverse_iterator set to 1 before the end of range.
Definition at line 372 of file IntRangeI.H.
|
inlinenoexcept |
A const_reverse_iterator set to 1 before the begin of range.
Definition at line 380 of file IntRangeI.H.
|
inlinenoexcept |
A const_reverse_iterator set to 1 before the begin of range.
Definition at line 388 of file IntRangeI.H.