46 #ifndef Foam_PtrList_H 47 #define Foam_PtrList_H 58 template<
class T>
class autoPtr;
59 template<
class T>
class refPtr;
60 template<
class T>
class tmp;
61 template<
class T>
class PtrList;
62 template<
class T> Istream&
operator>>(Istream& is, PtrList<T>& list);
92 inline explicit
PtrList(const label len);
101 inline explicit
PtrList(UList<
T*>& list);
104 template<class CloneArg>
115 PtrList(Istream& is, const INew& inew);
128 template<class... Args>
147 void resize(
const label newLen);
153 template<
class... Args>
160 inline void push_back(std::unique_ptr<T>&& ptr);
175 template<
class... Args>
183 inline autoPtr<T> set(
const label i, std::unique_ptr<T>&& ptr);
224 return this->
set(i, std::move(ptr));
236 void append(std::unique_ptr<T>&& ptr)
LPtrList< SLListBase, T > SLPtrList
Forward declarations for SLPtrList.
PtrList< T > clone(Args &&... args) const
Make a copy by cloning each of the list elements.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
void emplace_back(Args &&... args)
Construct and append an element to the end of the list.
void readIstream(Istream &is, const INew &inew)
Read from Istream using Istream constructor class.
A class for managing references or pointers (no reference counting)
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
autoPtr< T > emplace(const label i, Args &&... args)
Construct and set an element.
constexpr PtrList() noexcept
Default construct.
Istream & operator>>(Istream &, directionInfo &)
const T * set(const label i) const
Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie...
void free()
Delete the allocated entries, but retain the list size.
void operator=(const PtrList< T > &list)
Copy assignment.
void setSize(const label newLen)
Same as resize()
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
void resize(const label newLen)
Adjust size of PtrList.
void append(autoPtr< T > &ptr)
Move append an element to the end of the list.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
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.
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
void transfer(PtrList< T > &list)
Transfer into this list and annul the argument list.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
A class for managing temporary objects.
Foam::argList args(argc, argv)