Go to the documentation of this file.
43 const label len = this->size();
45 for (
label i=0; i<len; ++i)
47 this->ptrs_[i] = (list[i]).clone().ptr();
61 for (
auto iter = list.
cbegin(); iter != list.
cend(); ++iter)
63 this->ptrs_[i++] = (*iter).clone().ptr();
81 template<
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();
const_iterator cbegin() const
Iterator to first item in list with const access.
Non-intrusive singly-linked pointer list.
void operator=(const PtrList< T > &list)
Copy assignment.
Template class for non-intrusive linked PtrLists.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
patchWriters resize(patchIds.size())
constexpr PtrList() noexcept
Construct null.
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....
PtrList< T > clone(Args &&... args) const
Make a copy by cloning each of the list elements.
void resize(const label newLen)
Adjust size of PtrList.
const const_iterator & cend() const
End of list for forward iterators.
Foam::argList args(argc, argv)