A label range specifier. More...
Data Structures | |
class | const_iterator |
An STL const_iterator. More... | |
class | less |
Less function class for sorting labelRange. More... | |
Public Member Functions | |
labelRange () | |
Construct an empty range. More... | |
labelRange (const label start, const label size) | |
Construct a range. More... | |
labelRange (Istream &) | |
Construct from Istream. More... | |
void | clear () |
Reset to zero size. More... | |
bool | empty () const |
Is the range empty? More... | |
label | size () const |
Return the effective size of the range. More... | |
label | first () const |
The (inclusive) lower value of the range. More... | |
label | last () const |
The (inclusive) upper value of the range. More... | |
bool | contains (const label) const |
Return true if the value is within the range. More... | |
bool | intersects (const labelRange &, const bool touches=false) const |
Return true if the ranges intersect. More... | |
labelRange | join (const labelRange &) const |
Return a joined range, squashing any gaps in between. More... | |
label | operator[] (const label) const |
Return element in range, no bounds checking. More... | |
bool | operator< (const labelRange &rhs) const |
Comparison function for sorting, compares the start. More... | |
labelRange & | operator+= (const labelRange &) |
Join ranges, squashing any gaps in between. More... | |
bool | operator== (const labelRange &) const |
bool | operator!= (const labelRange &) const |
const_iterator | cbegin () const |
const_iterator set to the beginning of the range More... | |
const const_iterator & | cend () const |
const_iterator set to beyond the end of the range More... | |
const_iterator | begin () const |
const_iterator set to the beginning of the range More... | |
const const_iterator & | end () const |
const_iterator set to beyond the end of the range More... | |
Static Public Attributes | |
static int | debug |
Private Attributes | |
label | start_ |
label | size_ |
Static Private Attributes | |
static const const_iterator | endIter_ |
const_iterator returned by end(), cend() More... | |
Friends | |
Istream & | operator>> (Istream &, labelRange &) |
Ostream & | operator<< (Ostream &, const labelRange &) |
|
inline |
Construct an empty range.
Definition at line 29 of file labelRangeI.H.
|
inline |
Construct a range.
A negative size is autmatically changed to zero.
Definition at line 36 of file labelRangeI.H.
References labelRange::clear(), and labelRange::size_.
labelRange | ( | Istream & | is | ) |
Construct from Istream.
Definition at line 39 of file labelRange.C.
|
inline |
Reset to zero size.
Definition at line 143 of file labelRangeI.H.
References labelRange::size_, and labelRange::start_.
Referenced by labelRanges::add(), and labelRange::labelRange().
|
inline |
|
inline |
Return the effective size of the range.
Definition at line 155 of file labelRangeI.H.
References labelRange::size_.
|
inline |
The (inclusive) lower value of the range.
Definition at line 161 of file labelRangeI.H.
References labelRange::start_.
Referenced by labelRange::contains(), labelRange::less::operator()(), labelRange::operator+=(), labelRange::operator<(), and labelRanges::remove().
|
inline |
The (inclusive) upper value of the range.
Definition at line 167 of file labelRangeI.H.
References labelRange::size_, and labelRange::start_.
Referenced by labelRange::contains(), labelRange::operator+=(), and labelRanges::remove().
|
inline |
Return true if the value is within the range.
Definition at line 173 of file labelRangeI.H.
References labelRange::first(), and labelRange::last().
bool intersects | ( | const labelRange & | range, |
const bool | touches = false |
||
) | const |
Return true if the ranges intersect.
Optional test for ranges that also just touch each other
Definition at line 51 of file labelRange.C.
References range.
Referenced by labelRanges::add().
Foam::labelRange join | ( | const labelRange & | range | ) | const |
Return a joined range, squashing any gaps in between.
A prior intersects() check can be used to avoid squashing gaps.
Definition at line 78 of file labelRange.C.
References Foam::max(), Foam::min(), and range.
|
inline |
Return element in range, no bounds checking.
Definition at line 181 of file labelRangeI.H.
References labelRange::start_.
|
inline |
Comparison function for sorting, compares the start.
Definition at line 187 of file labelRangeI.H.
References labelRange::first().
Foam::labelRange & operator+= | ( | const labelRange & | rhs | ) |
Join ranges, squashing any gaps in between.
A prior intersects() check can be used to avoid squashing gaps.
Definition at line 100 of file labelRange.C.
References labelRange::first(), labelRange::last(), Foam::max(), Foam::min(), and labelRange::size_.
|
inline |
Definition at line 193 of file labelRangeI.H.
References labelRange::size_, and labelRange::start_.
Referenced by labelRange::operator!=(), and labelRange::const_iterator::operator!=().
|
inline |
Definition at line 199 of file labelRangeI.H.
References labelRange::operator==().
|
inline |
const_iterator set to the beginning of the range
Definition at line 117 of file labelRangeI.H.
|
inline |
const_iterator set to beyond the end of the range
Definition at line 123 of file labelRangeI.H.
References labelRange::endIter_.
|
inline |
const_iterator set to the beginning of the range
Definition at line 129 of file labelRangeI.H.
|
inline |
const_iterator set to beyond the end of the range
Definition at line 135 of file labelRangeI.H.
References labelRange::endIter_.
|
friend |
|
friend |
|
private |
Definition at line 60 of file labelRange.H.
Referenced by labelRange::clear(), labelRange::first(), labelRange::last(), labelRange::operator==(), and labelRange::operator[]().
|
private |
Definition at line 61 of file labelRange.H.
Referenced by labelRange::clear(), labelRange::empty(), labelRange::labelRange(), labelRange::last(), labelRange::operator+=(), labelRange::operator==(), and labelRange::size().
|
static |
Definition at line 65 of file labelRange.H.
Referenced by main(), and labelRanges::remove().
|
staticprivate |
const_iterator returned by end(), cend()
Definition at line 199 of file labelRange.H.
Referenced by labelRange::cend(), and labelRange::end().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.