Go to the documentation of this file.
86 template<
class CloneArg>
90 const CloneArg& cloneArg
102 (this->ptrs_).free();
166 return set(i, aptr.release());
173 return set(i, tptr.
ptr());
180 if (i < 0 || i >= this->size())
192 (this->ptrs_).free();
202 this->transfer(list);
A class for managing temporary objects.
void operator=(const PtrList< T > &list)
Copy assignment.
autoPtr< T > release(const label i)
Release ownership of the pointer at the given position.
#define forAll(list, i)
Loop across all elements in list.
patchWriters resize(patchIds.size())
T * release() noexcept
Return pointer to the managed object and release ownership.
void setSize(const label newLen)
Same as resize()
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....
void append(T *ptr)
Append an element to the end of the list.
PtrList< T > clone(Args &&... args) const
Make a copy by cloning each of the list elements.
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
const T * set(const label i) const
Return const pointer to element (if set) or nullptr.
void free()
Delete the allocated entries, but retain the list size.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
void transfer(PtrList< T > &list)
Transfer into this list and annul the argument list.