Go to the documentation of this file.
56 return NullObjectRef<UList<T>>();
63 return (i == size()-1 ? 0 : i+1);
70 return this->operator[](this->fcIndex(i));
77 return this->operator[](this->fcIndex(i));
84 return (i ? i-1 : size()-1);
91 return this->operator[](this->rcIndex(i));
98 return this->operator[](this->rcIndex(i));
105 if (start < 0 || (start && start >= size_))
109 <<
"start " << start <<
" out of range [0," << size_ <<
"]"
118 if (size < 0 || size > size_)
121 <<
"size " << size <<
" out of range [0," << size_ <<
"]"
133 <<
"attempt to access element " << i <<
" from zero sized list"
136 else if (i < 0 || i >= size_)
139 <<
"index " << i <<
" out of range [0," << size_ <<
"]"
148 const label len = size();
155 const T& val = first();
157 for (label i=1; i<len; ++i)
159 if (val != (*
this)[i])
172 return this->operator[](0);
179 return this->operator[](0);
186 return this->operator[](this->size()-1);
193 return this->operator[](this->size()-1);
214 return (this->
find(val,
pos) >= 0);
235 if (i >= 0 && i < size_)
268 return *
reinterpret_cast<const List<T>*
>(
this);
398 for (label i=0; i<
n/2; ++i)
const_iterator cbegin() const
Return const_iterator to begin traversing the constant UList.
void reverse(UList< T > &list, const label n)
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
const_iterator cend() const
Return const_iterator to end traversing the constant UList.
T & first()
Return the first element of the list.
constexpr UList() noexcept
Default construct, zero-sized and nullptr.
T * data()
Return a pointer to the first data element.
void checkSize(const label size) const
Check size is within valid range [0,size].
bool uniform() const
True if all entries have identical values, and list is non-empty.
void Swap(DynamicList< T, SizeMin1 > &a, DynamicList< T, SizeMin2 > &b)
label rcIndex(const label i) const
iterator begin()
Return an iterator to begin traversing the UList.
Swap arguments as per std::swap, but in Foam namespace.
void checkStart(const label start) const
Check start is within valid range [0,size)
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
T * iterator
Random access iterator for traversing a UList.
T & last()
Return the last element of the list.
const_reverse_iterator crend() const
Return const_reverse_iterator to end reverse traversing the UList.
bool empty() const noexcept
True if the UList is empty (ie, size() is zero)
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
label find(const ListType &input, const UnaryPredicate &pred, const label start=0)
Find index of the first occurrence that satisfies the predicate.
errorManip< error > abort(error &err)
reverse_iterator rend()
Return reverse_iterator to end reverse traversing the UList.
const T & fcValue(const label i) const
Return forward circular value (ie, next value in the list)
void shallowCopy(const UList< T > &list)
Copy the pointer held by the given UList.
void swap(UList< T > &list)
Swap content with another UList of the same type in constant time.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label fcIndex(const label i) const
reverse_iterator rbegin()
Return reverse_iterator to begin reverse traversing the UList.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Traits class for primitives.
T & operator[](const label i)
Return element of UList.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
label size() const noexcept
The number of elements in the UList.
const T * cdata() const
Return a const pointer to the first data element.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
bool found(const T &val, label pos=0) const
True if the value if found in the list.
std::reverse_iterator< const_iterator > const_reverse_iterator
Reverse iterator (const access)
static const UList< T > & null()
Return a UList reference to a nullObject.
iterator end()
Return an iterator to end traversing the UList.
std::reverse_iterator< iterator > reverse_iterator
Reverse iterator (non-const access)
void checkIndex(const label i) const
Check index is within valid range [0,size)
const T & rcValue(const label i) const
Return reverse circular value (ie, previous value in the list)
const_reverse_iterator crbegin() const
Return const_reverse_iterator to begin reverse traversing the UList.
dimensionedScalar pos(const dimensionedScalar &ds)