Go to the documentation of this file.
45 #include <type_traits>
55 template<
class T,
int SizeMin>
class PtrDynList;
61 template<
class T,
int SizeMin=64>
66 static_assert(SizeMin > 0,
"Invalid min size parameter");
103 inline label
capacity() const noexcept;
107 inline const
T*
get(const label i) const;
112 const
T*
set(const label i)
const {
return this->
get(i); }
118 inline void reserve(
const label len);
121 inline void resize(
const label newLen);
152 template<
int AnySizeMin>
156 template<class... Args>
169 inline
void append(std::unique_ptr<
T>&& ptr);
181 template<
int AnySizeMin>
188 template<class... Args>
201 inline
autoPtr<
T>
set(const label i, std::unique_ptr<
T>&& ptr);
216 inline
void operator=(const
PtrList<
T>& list);
219 inline
void operator=(const
PtrDynList<
T, SizeMin>& list);
222 template<
int AnySizeMin>
223 inline
void operator=(const
PtrDynList<
T, AnySizeMin>& list);
226 inline
void operator=(
PtrList<
T>&& list);
229 inline
void operator=(
PtrDynList<
T, SizeMin>&& list);
232 template<
int AnySizeMin>
233 inline
void operator=(
PtrDynList<
T, AnySizeMin>&& list);
243 #include "PtrDynListI.H"
const T * set(const label i) const
Return const pointer to element (if set) or nullptr,.
void swap(PtrDynList< T, AnySizeMin > &other)
Swap content, independent of sizing parameter.
A class for managing temporary objects.
label expandStorage() noexcept
Expand the addressable size to fit the allocated capacity.
label capacity() const noexcept
Size of the underlying storage.
void reorder(const labelUList &oldToNew)
Reorder elements. Reordering must be unique (ie, shuffle).
void append(T *ptr)
Append an element to the end of the list.
A dynamically resizable PtrList with allocation management.
void resize(const label newLen)
Alter the addressed list size.
void shrink()
Shrink the allocated space to the number of elements used.
autoPtr< T > remove()
Remove and return the top element.
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void setSize(const label n)
Same as resize()
void clearStorage()
Clear the list and delete storage.
void clear()
Clear the addressed list, i.e. set the size to zero.
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.
constexpr PtrDynList() noexcept
Default construct.
void emplace_append(Args &&... args)
Construct and append an element to the end of the list.
void reserve(const label len)
Reserve allocation space for at least this size.
Foam::argList args(argc, argv)
const T * get(const label i) const
Return const pointer to element (can be nullptr),.
A class for managing references or pointers (no reference counting)