Go to the documentation of this file.
104 class const_iterator;
110 inline constexpr
UPtrList() noexcept;
113 inline explicit
UPtrList(const label len);
143 inline label
size() const noexcept;
146 inline
bool empty() const noexcept;
152 inline const
T&
first() const;
158 inline const
T&
last() const;
162 inline
T*
get(const label i);
166 inline const
T*
get(const label i) const;
171 const
T*
set(const label i)
const {
return this->
get(i); }
181 inline void resize(
const label newLen);
184 inline void setSize(
const label newLen);
202 inline T*
set(
const label i,
T* ptr);
295 const T*
const* ptr_;
const_iterator operator-(difference_type n) const
bool operator==(const const_iterator &iter) const
label size() const noexcept
The number of elements in the list.
T & first()
Return reference to the first element of the list.
bool operator<(const const_iterator &iter) const
iterator begin()
Return an iterator to begin traversing the UPtrList.
void clear()
Set list size to zero.
bool operator>=(const iterator &iter) const
void swap(UPtrList< T > &list)
Swap content.
void append(T *ptr)
Append an element to the end of the list.
const_iterator & operator+=(difference_type n)
const_iterator & operator++()
Detail::PtrListDetail< T > ptrs_
The list of pointers.
T & reference
A non-const reference to the value_type.
T * get(const label i)
Return pointer to element (can be nullptr),.
void operator=(const UPtrList< T > &list)
Copy assignment (shallow copies addresses)
reference operator()() const
reference operator*() const
iterator operator+(difference_type n) const
bool operator<=(const iterator &iter) const
Random-access iterator with const access.
pointer get() const
Return pointer, can be nullptr.
bool operator>(const const_iterator &iter) const
bool operator!=(const iterator &iter) const
void transfer(UPtrList< T > &list)
Transfer contents into this list and annul the argument.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
void resize(const label newLen)
Reset size of list.
T value_type
Type of values the list contains.
bool operator>=(const const_iterator &iter) const
bool operator!=(const const_iterator &iter) const
reference operator()() const
Random-access iterator with non-const access.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
pointer get() const
Return pointer, can be nullptr.
constexpr UPtrList() noexcept
Default construct.
void sortOrder(const labelUList &order, const bool testNull=true)
const_iterator & operator--()
std::random_access_iterator_tag iterator_category
reference operator*() const
iterator operator-(difference_type n) const
bool operator<=(const const_iterator &iter) const
const_iterator operator+(difference_type n) const
pointer operator->() const
bool operator>(const iterator &iter) const
const_iterator cend() const
Return an const_iterator to end traversing the UPtrList.
iterator(T **ptr)
Construct for a given entry.
bool operator==(const iterator &iter) const
reference operator[](difference_type n) const
const T * set(const label i) const
Return const pointer to element (can be nullptr),.
iterator end()
Return an iterator to end traversing the UPtrList.
reference operator[](difference_type n) const
T & last()
Return reference to the last element of the list.
label squeezeNull()
Squeeze out intermediate nullptr entries in the list of pointers.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const_iterator & operator-=(difference_type n)
const T & operator[](const label i) const
Return const reference to the element.
A rudimentary list of pointers used for PtrList, UPtrList, etc. This class is considered implementati...
pointer operator->() const
std::random_access_iterator_tag iterator_category
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void reorder(const labelUList &oldToNew, const bool testNull=true)
const T * operator()(const label i) const
Return const pointer to the element - same as get().
bool operator<(const iterator &iter) const
const typedef T & const_reference
A const reference to the value_type.
iterator & operator+=(difference_type n)
iterator & operator-=(difference_type n)
const_iterator cbegin() const
Return an const_iterator to begin traversing the UPtrList.
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
const_iterator(const T *const *ptr)
Construct for a given entry.
void setSize(const label newLen)
Same as resize()