Go to the documentation of this file.
48 ptrs_(std::move(ptrs))
62 ptrs_(std::move(list.ptrs_))
69 ptrs_(list.ptrs_, reuse)
85 const label len = ptrs_.size();
87 for (label i=0; i<len; ++i)
89 ptrs_[i] = &(list[i]);
106 return ptrs_.empty();
134 ptrs_.swap(list.
ptrs_);
141 ptrs_.transfer(list.
ptrs_);
148 return this->operator[](0);
155 return this->operator[](0);
162 return this->operator[](this->size()-1);
169 return this->operator[](this->size()-1);
176 ptrs_.resize(newLen);
183 ptrs_.resize(newLen);
190 const label idx = this->size();
191 ptrs_.resize(idx + 1);
214 const T* ptr = ptrs_[i];
219 <<
"Cannot dereference nullptr at index " << i
220 <<
" in range [0," << size() <<
")\n"
236 <<
"Cannot dereference nullptr at index " << i
237 <<
" in range [0," << size() <<
")\n"
271 return ptr_ == iter.ptr_;
278 return ptr_ != iter.ptr_;
379 return (ptr_ - iter.ptr_);
393 return ptr_ < iter.ptr_;
400 return ptr_ > iter.ptr_;
407 return ptr_ <= iter.ptr_;
414 return ptr_ >= iter.ptr_;
447 return ptr_ == iter.ptr_;
457 return ptr_ != iter.ptr_;
558 return (ptr_ - iter.ptr_);
576 return ptr_ < iter.ptr_;
586 return ptr_ > iter.ptr_;
596 return ptr_ <= iter.ptr_;
606 return ptr_ >= iter.ptr_;
616 return ptrs_.begin();
632 return ptrs_.cbegin();
648 return ptrs_.begin();
672 ptrs_.transfer(list.ptrs_);
const_iterator operator-(difference_type n) const
label size() const noexcept
The number of elements in the list.
T & first()
Return reference to the first element of the list.
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 * 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 iterator &iter) const
void transfer(UPtrList< T > &list)
Transfer contents into this list and annul the argument.
void resize(const label newLen)
Reset size of list.
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...
pointer get() const
Return pointer, can be nullptr.
constexpr UPtrList() noexcept
Default construct.
const_iterator & operator--()
reference operator*() const
errorManip< error > abort(error &err)
iterator operator-(difference_type n) 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
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
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
const T * operator()(const label i) const
Return const pointer to the element - same as get().
bool operator<(const iterator &iter) const
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()