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");
77 void setAddressableSize(
const label len);
109 inline label
capacity() const noexcept;
113 inline const
T*
get(const label i) const;
118 const
T*
set(const label i)
const {
return this->
get(i); }
130 inline void resize(
const label newLen);
133 inline void setSize(
const label newLen);
137 inline void reserve(
const label nElem);
159 template<
class... Args>
172 inline void append(std::unique_ptr<T>&& ptr);
184 template<
int AnySizeMin>
191 template<
class... Args>
204 inline autoPtr<T> set(
const label i, std::unique_ptr<T>&& ptr);
225 template<
int AnySizeMin>
235 template<
int AnySizeMin>
void reserve(const label nElem)
Reserve allocation space for at least this size.
const T * set(const label i) const
Return const pointer to element (if set) or nullptr,.
void setSize(const label newLen)
Same as resize()
label expandStorage()
Expand the addressable size to fit the allocated capacity.
A class for managing temporary objects.
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 setCapacity(const label nElem)
Alter the size of the underlying storage.
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 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.
void operator=(const PtrList< T > &list)
Copy (clone) assignment.
constexpr PtrDynList() noexcept
Construct null.
void emplace_append(Args &&... args)
Construct and append an element to the end of the list.
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)