Go to the documentation of this file.
78 list =
reinterpret_cast<T*
>(0);
83 template<
class CloneArg>
87 const CloneArg& cloneArg
105 template<
class... Args>
155 template<
class... Args>
162 return set(i,
new T(std::forward<Args>(
args)...));
203 std::unique_ptr<T>&& ptr
235 if (i < 0 || i >= this->size())
247 (this->ptrs_).free();
257 this->transfer(list);
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
A class for managing temporary objects.
void emplace_append(Args &&... args)
Construct and append an element to the end of the list.
void operator=(const PtrList< T > &list)
Copy assignment.
autoPtr< T > release(const label i)
Release ownership of the pointer at the given position.
const T * set(const label i) const
Return const pointer to element (can be nullptr),.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
T * release() noexcept
Release ownership and return the pointer.
constexpr PtrList() noexcept
Default construct.
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.
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
void free()
Delete the allocated entries, but retain the list size.
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
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...
autoPtr< T > emplace(const label i, Args &&... args)
Construct and set an element.
Foam::argList args(argc, argv)
autoPtr< T > set(const label i, autoPtr< T > &ptr)
Set element to given autoPtr and return old element.
void transfer(PtrList< T > &list)
Transfer into this list and annul the argument list.
A class for managing references or pointers (no reference counting)