39#ifndef Foam_labelRanges_H
40#define Foam_labelRanges_H
107 inline explicit labelRanges(
const label initialCapacity);
116 template<
int AnySizeMin>
135 void reserve(
const label len) { ranges_.reserve(len); }
151 template<class... Args>
164 label operator[](const label i) const;
190 const label subIdx = 0
197 inline label operator*() const;
255 bool found(const label value)
const {
return contains(value); }
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool empty() const noexcept
True if List is empty (ie, size() is zero).
A range or interval of labels defined by a start and a size.
Forward input iterator with const access.
const_iterator & operator++()
constexpr const_iterator(const UList< labelRange > *list, const label idx=0, const label subIdx=0) noexcept
Construct from range list at given index (and sub-index).
A list of labelRange with constrained list capabilities.
void clear() noexcept
Clear the addressable list of ranges.
bool remove(const labelRange &range)
Remove the range from the list.
Ostream & writeList(Ostream &os, const label shortLen=0) const
Write List of labelRange, with line-breaks in ASCII when length exceeds shortLen.
labelRange & emplace_back(Args &&... args)
Construct a range element at the end of the list, return reference to the new element.
labelRanges()=default
Default construct.
labelRanges(labelRanges &&)=default
Default move construct.
Istream & readList(Istream &is)
Read List of labelRange from Istream, discarding contents.
const_iterator cbegin() const noexcept
A const_iterator set to the beginning of the list.
labelRanges(const labelRanges &)=default
Default copy construct.
const_iterator begin() const noexcept
A const_iterator set to the beginning of the list.
label totalSize() const noexcept
The linear size (sum of all the element sizes).
bool contains(const label value) const noexcept
True if the value is contained within any of the sub-ranges.
labelRanges(Istream &is)
Construct from Istream.
bool empty() const noexcept
True if list of ranges is empty.
bool found(const label value) const
Same as contains().
void sort()
Inplace sort of the range elements.
const UList< labelRange > & ranges() const noexcept
The list of ranges.
const const_iterator cend() const noexcept
A const_iterator set to beyond the end of the list.
bool add(const labelRange &range)
Add the range to the list.
labelRanges & operator=(labelRanges &&)=default
Default move assignment.
const const_iterator end() const noexcept
A const_iterator set to beyond the end of the list.
void reserve(const label len)
Reserve space for at least this size.
List< label > labels() const
Return flattened list of all range labels.
labelRanges & operator=(const labelRanges &)=default
Default copy assignment.
labelRange value_type
The value type the list contains.
OBJstream os(runTime.globalPath()/outputName)
bool operator!=(const eddy &a, const eddy &b)
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
Istream & operator>>(Istream &, directionInfo &)
srcOptions insert("case", fileName(rootDirSource/caseDirSource))
Foam::argList args(argc, argv)