59template<
class T>
class refPtr;
60template<
class T>
class tmp;
78 template<
bool CheckSelf>
99 inline explicit
PtrList(const label len);
111 template<class CloneArg>
135 template<class... Args>
157 void resize(
const label newLen);
166 template<
class... Args>
173 inline void push_back(std::unique_ptr<T>&& ptr);
192 template<
class... Args>
196 template<
class... Args>
204 template<
class... Args>
212 inline autoPtr<T> set(
const label i, std::unique_ptr<T>&& ptr);
278 void append(std::unique_ptr<T>&& ptr)
Forward declarations for SLPtrList.
A helper class when constructing from an Istream or dictionary.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
T & emplace(const label i, Args &&... args)
Same as emplace_set().
void transfer(PtrList< T > &list)
Transfer into this list and annul the argument list.
void append(PtrList< T > &&other)
Move append another list to the end of this list.
const faPatch * set(const label i) const
void push_back(const tmp< T > &ptr)
Move or clone append a tmp to the end of the list.
void append(T *ptr)
Append an element to the end of the list.
void setSize(const label n)
Same as resize().
void append(const refPtr< T > &ptr)
Move or clone append a tmp to the end of the list.
PtrList< faPatch > clone(Args &&... args) const
autoPtr< T > set(const label i, std::unique_ptr< T > &&ptr)
Set element to given unique_ptr and return old element.
autoPtr< T > release(const label i)
Release ownership of the pointer at the given position.
void push_back(T *ptr)
Append an element to the end of the list.
T & emplace_back(Args &&... args)
Construct and append an element to the end of the list, return reference to the new list element.
void operator=(PtrList< T > &&list)
Move assignment.
void push_back(std::unique_ptr< T > &&ptr)
Move append an element to the end of the list.
void operator=(const UPtrList< T > &list)
Copy assignment.
void push_back(const refPtr< T > &ptr)
Move or clone append a refPtr to the end of the list.
T & emplace_set(const label i, Args &&... args)
Construct and set a new element at given position, (discard old element at that location).
autoPtr< T > set(const label i, autoPtr< T > &ptr)
Set element to given autoPtr and return old element.
void append(const tmp< T > &ptr)
Move or clone append a tmp to the end of the list.
autoPtr< T > set(const label i, T *ptr)
Set element to given pointer and return old element (can be null).
void append(autoPtr< T > &ptr)
Move append an element to the end of the list.
T & try_emplace(const label i, Args &&... args)
Like emplace_set() but will not overwrite an occupied (non-null) location.
void push_back(PtrList< T > &&other)
Move append another list to the end of this list.
void append(autoPtr< T > &&ptr)
Move append an element to the end of the list.
void append(std::unique_ptr< T > &&ptr)
Move append an element to the end of the list.
void free()
Free memory and nullify all entries. Does not change the list size.
void resize_null(const label newLen)
Set the addressed list to the given size, deleting all existing entries. Afterwards the list contains...
void readIstream(Istream &is, const INew &inew)
Read from Istream using Istream constructor class.
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
autoPtr< T > set(const label i, const tmp< T > &ptr)
Set element to given tmp and return old element.
void push_back(autoPtr< T > &ptr)=delete
Disallow push_back with autoPtr without std::move.
void push_back(autoPtr< T > &&ptr)
Move append an element to the end of the list.
autoPtr< T > set(const label i, const refPtr< T > &ptr)
Set element to given refPtr and return old element.
constexpr PtrList() noexcept
Default construct.
autoPtr< T > set(const label i, autoPtr< T > &&ptr)
Set element to given autoPtr and return old element.
void operator=(const PtrList< T > &list)
Copy assignment.
void resize(const label newLen)
Adjust size of PtrList.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie,...
UPtrList(Detail::PtrListDetail< T > &&ptrs) noexcept
Low-level move construct.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
T * release() noexcept
Release ownership and return the pointer.
A class for managing references or pointers (no reference counting).
A class for managing temporary objects.
Istream & operator>>(Istream &, directionInfo &)
LPtrList< SLListBase, T > SLPtrList
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
Foam::argList args(argc, argv)