43 const label len = this->
size();
45 for (label i=0; i<len; ++i)
61 for (
auto iter = list.
cbegin(); iter != list.
cend(); ++iter)
63 this->
ptrs_[i++] = (*iter).clone().ptr();
81template<
class... Args>
84 const label len = this->size();
88 for (label i=0; i<len; ++i)
90 const T* ptr = this->ptrs_[i];
94 cloned.
ptrs_[i] = ptr->clone(std::forward<Args>(
args)...).ptr();
105 const label oldLen = this->size();
111 else if (newLen != oldLen)
114 for (label i=newLen; i<oldLen; ++i)
116 T* ptr = this->ptrs_[i];
125 (this->ptrs_).
resize(newLen);
140 const label oldLen = this->size();
141 const label newLen = list.
size();
149 for (label i=0; i<newLen; ++i)
151 (*this)[i] = list[i];
157 for (label i=0; i<oldLen; ++i)
159 (*this)[i] = list[i];
163 for (label i=oldLen; i<newLen; ++i)
165 this->ptrs_[i] = (list[i]).clone().ptr();
Non-intrusive singly-linked pointer list.
virtual bool resize()
Resize the ODE solver.
Template class for non-intrusive linked PtrLists.
const_iterator cbegin() const
Iterator to first item in list with const access.
const const_iterator & cend() const
End of list for forward iterators.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
PtrList< T > clone(Args &&... args) const
Make a copy by cloning each of the list elements.
constexpr PtrList() noexcept
Default construct.
void operator=(const PtrList< T > &list)
Copy assignment.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
label size() const noexcept
The number of elements in the list.
Detail::PtrListDetail< T > ptrs_
The list of pointers.
virtual tmp< fvPatchScalarField > clone() const
Construct and return a clone.
patchWriters resize(patchIds.size())
Foam::argList args(argc, argv)