78 list =
reinterpret_cast<T*
>(0);
83template<
class CloneArg>
87 const CloneArg& cloneArg
105template<
class... Args>
160 <<
"Attempted append to self"
164 const label idx = this->size();
165 const label len = other.size();
169 for (label i = 0; i < len; ++i)
171 set(idx + i, other.release(i));
179template<
class... Args>
186 return set(i,
new T(std::forward<Args>(
args)...));
208 return set(i, ptr.release());
219 return set(i, ptr.release());
227 std::unique_ptr<T>&& ptr
230 return set(i, ptr.release());
241 return set(i, ptr.
ptr());
252 return set(i, ptr.
ptr());
259 if (i < 0 || i >= this->size())
271 (this->ptrs_).free();
281 this->transfer(list);
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void emplace_append(Args &&... args)
Construct and append an element to the end of the list.
void free()
Delete the allocated entries, but retain the list size.
autoPtr< T > emplace(const label i, Args &&... args)
Construct and set an element.
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
constexpr PtrList() noexcept
Default construct.
void operator=(const PtrList< T > &list)
Copy assignment.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
void clear()
Set list size to zero.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
T * release() noexcept
Release ownership and return the pointer.
std::istream * release() noexcept
Return managed pointer and release ownership.
A class for managing references or pointers (no reference counting)
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
transferModelList & transfer()
Transfer.
A class for managing temporary objects.
T * ptr() const
Return managed pointer for reuse, or clone() the object reference.
bool set() const
Are all the vector set.
bool append() const noexcept
True if output format uses an append mode.
patchWriters resize(patchIds.size())
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManip< error > abort(error &err)
Foam::argList args(argc, argv)