Go to the documentation of this file.
47 if (size_ < 0) size_ = 0;
55 const bool adjustStart
83 + ((i < 0 || i >
range->size()) ?
range->size() : i)
127 inline bool Foam::labelRange::const_iterator::operator==
132 return (value_ == iter.value_);
136 inline bool Foam::labelRange::const_iterator::operator!=
141 return (value_ != iter.value_);
197 if (size_ < 0) size_ = 0;
204 if (size_ < 0) size_ = 0;
258 return start_ + size_ - 1;
264 return start_ + size_ - 1;
270 return start_ + size_;
283 if (size_ < 0) size_ = 0;
293 const bool adjustStart
314 return (size_ && start_ <= value && (value - start_) < size_);
347 if (size_ < 0) size_ = 0;
354 const label old(size_);
356 if (size_ < 0) size_ = 0;
371 if (size_ < 0) size_ = 0;
void setSize(const label n) noexcept
Change the size - alias for resize()
bool reset(const label start, const label size) noexcept
Reset start and size, enforcing non-negative size.
label operator*() const noexcept
Return the (global) value.
const_iterator cbegin() const
A const_iterator set to the beginning of the range.
label before() const noexcept
The value before the start of the range.
const const_iterator end() const
A const_iterator set to 1 beyond the end of the range.
label operator++() noexcept
Increase the size by 1.
const const_iterator cend() const
A const_iterator set to 1 beyond the end of the range.
label size() const noexcept
The effective size of the range.
const_iterator & operator+=(const label n) noexcept
Arbitrary increment, no range checking.
void clear() noexcept
Reset to zero start and zero size.
label after() const noexcept
The value after the last element in the range.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool found(const label value) const noexcept
Return true if the (global) value is located within the range.
const_iterator & operator++() noexcept
Prefix increment, no range checking.
label max() const noexcept
The (inclusive) upper value of the range - same as last()
A range or interval of labels defined by a start and a size.
const_iterator at(const label i) const
void resize(const label n) noexcept
Change the size, enforcing non-negative size.
label operator--() noexcept
Decrease the size by 1, but never below 0.
label first() const noexcept
The (inclusive) lower value of the range - same as start()
Forward iterator with const access.
const_iterator(const labelRange *range, const label i=0)
Construct from range at given local index.
bool operator()(const label value) const noexcept
Return true if the global value is located within the range.
label last() const noexcept
The (inclusive) upper value of the range - same as max()
bool empty() const noexcept
Is the range empty?
constexpr labelRange() noexcept
An empty range with zero for start/size.
label ListType::const_reference const label start
label operator+=(const label n) noexcept
Increase the size by n.
label start() const noexcept
The (inclusive) lower value of the range.
static labelRange identity(const label len, const label start=0) noexcept
void setStart(const label i) noexcept
Change the start position.
const_iterator begin() const
A const_iterator set to the beginning of the range.
label min() const noexcept
The (inclusive) lower value of the range - same as start(), first()
label operator-=(const label n) noexcept
Decrease the size by n, but never below 0.
bool valid() const noexcept
Is the range non-empty?
label operator[](const label i) const noexcept
Return element in the range, without bounds checking.
const_iterator & operator-=(const label n) noexcept
Arbitrary decrement, no range checking.