33 ranges_(initialCapacity)
45 ranges_(std::move(list))
49template<
int AnySizeMin>
55 ranges_(std::move(list))
78 return (*list_)[index_][subIndex_];
87 if (++subIndex_ >= (*list_)[index_].size())
109Foam::labelRanges::const_iterator::
117 index_ == iter.index_
118 && subIndex_ == iter.subIndex_
124Foam::labelRanges::const_iterator::
130 return !(*
this == iter);
141 if (
range.size() > 0)
154 if (
range.contains(value))
164template<
class... Args>
167 return ranges_.emplace_back(
args...);
210 if (i <= 0)
return this->cbegin();
217 if (subIdx <
range.size())
224 if (
range.size() > 0)
226 subIdx -=
range.size();
238 return this->cbegin(i);
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A range or interval of labels defined by a start and a size.
Forward input iterator with const access.
const_iterator & operator++()
label operator*() const
Return the current label.
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).
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.
const_iterator cbegin() const noexcept
A const_iterator set to the beginning of the list.
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.
void sort()
Inplace sort of the range elements.
const const_iterator cend() const noexcept
A const_iterator set to beyond the end of the list.
const const_iterator end() const noexcept
A const_iterator set to beyond the end of the list.
void sort(UList< T > &list)
Sort the list.
Foam::argList args(argc, argv)