34 ptrs_.setAddressableSize(
n);
57 ptrs_(std::move(ptrs))
71 ptrs_(std::move(list.ptrs_))
78 ptrs_(list.ptrs_, reuse)
94 const label len =
ptrs_.size();
96 for (label i = 0; i < len; ++i)
98 ptrs_[i] = &(list[i]);
115 return ptrs_.empty();
122 return (i >= 0 && i < ptrs_.size()) ? ptrs_[i] :
nullptr;
150 ptrs_.swap(list.
ptrs_);
157 ptrs_.transfer(list.
ptrs_);
164 return this->operator[](0);
171 return this->operator[](0);
178 return this->operator[](this->size()-1);
185 return this->operator[](this->size()-1);
192 ptrs_.resize(newLen);
206 ptrs_.append(other.ptrs_);
227 ptrs_.checkNonNull();
236 const T* ptr = ptrs_[i];
241 <<
"Cannot dereference nullptr at index " << i
242 <<
" in range [0," << size() <<
")\n"
258 <<
"Cannot dereference nullptr at index " << i
259 <<
" in range [0," << size() <<
")\n"
343 iterator iter(*
this);
371 return iterator(ptr_ +
n);
388 return (ptr_ - iter.ptr_);
396 return ptr_ == iter.ptr_;
404 return ptr_ != iter.ptr_;
412 return ptr_ < iter.ptr_;
418operator>(
const iterator& iter)
const noexcept
420 return ptr_ > iter.ptr_;
426operator<=(
const iterator& iter)
const noexcept
428 return ptr_ <= iter.ptr_;
436 return ptr_ >= iter.ptr_;
564 return (ptr_ - iter.ptr_);
572 return ptr_ == iter.ptr_;
580 return ptr_ != iter.ptr_;
588 return ptr_ < iter.ptr_;
596 return ptr_ > iter.ptr_;
604 return ptr_ <= iter.ptr_;
612 return ptr_ >= iter.ptr_;
622 return ptrs_.begin();
638 return ptrs_.cbegin();
654 return ptrs_.begin();
678 ptrs_.transfer(list.ptrs_);
A rudimentary list of pointers used for PtrList, UPtrList, etc. This class is considered implementati...
virtual bool resize()
Resize the ODE solver.
unsigned int get() const
Get value as unsigned, no range-checking.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Random-access iterator with const access.
reference operator*() const
const_iterator & operator+=(difference_type n) noexcept
bool operator<=(const const_iterator &iter) const noexcept
bool operator>=(const const_iterator &iter) const noexcept
const_iterator & operator++() noexcept
const_iterator & operator--() noexcept
bool operator>(const const_iterator &iter) const noexcept
const_iterator & operator-=(difference_type n) noexcept
pointer operator->() const
bool operator<(const const_iterator &iter) const noexcept
pointer get() const
Return pointer, can be nullptr.
reference operator[](difference_type n) const
Random-access iterator with non-const access.
reference operator*() const
iterator & operator--() noexcept
iterator & operator+=(difference_type n) noexcept
bool operator>(const iterator &iter) const noexcept
pointer operator->() const
bool operator<=(const iterator &iter) const noexcept
iterator & operator-=(difference_type n) noexcept
bool operator>=(const iterator &iter) const noexcept
bool operator<(const iterator &iter) const noexcept
reference operator[](difference_type n) const
pointer get() const
Return pointer, can be nullptr.
iterator & operator++() noexcept
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
const T & operator[](const label i) const
Return const reference to the element.
void swap(UPtrList< T > &list)
Swap content.
T & first()
Return reference to the first element of the list.
bool empty() const noexcept
True if the list is empty (ie, size() is zero)
void operator=(const UPtrList< T > &list)
Copy assignment (shallow copies addresses)
const_iterator cbegin() const noexcept
Return const_iterator to begin of UPtrList traversal.
constexpr UPtrList() noexcept
Default construct.
const T * test(const label i) const
const_iterator cend() const noexcept
Return const_iterator beyond end of UPtrList traversal.
label size() const noexcept
The number of elements in the list.
Detail::PtrListDetail< T > ptrs_
The list of pointers.
void clear()
Set list size to zero.
void checkNonNull() const
Check and raise FatalError if any nullptr exists in the list.
iterator begin() noexcept
Return an iterator to begin of UPtrList traversal.
iterator end() noexcept
Return iterator beyond end of UPtrList traversal.
void setAddressableSize(const label n) noexcept
Adjust addressable size.
T & last()
Return reference to the last element of the list.
friend complex operator+(const complex &c1, const complex &c2)
Ostream & operator()() const
Output stream (master only).
friend bool operator!=(const refineCell &rc1, const refineCell &rc2)
friend bool operator==(const refineCell &rc1, const refineCell &rc2)
transferModelList & transfer()
Transfer.
bool set() const
Are all the vector set.
bool append() const noexcept
True if output format uses an append mode.
zeroField operator-() const noexcept
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)