34template<
class T,
int SizeMin>
42template<
class T,
int SizeMin>
52template<
class T,
int SizeMin>
63template<
class T,
int SizeMin>
70 capacity_(list.capacity_)
76template<
class T,
int SizeMin>
87template<
class T,
int SizeMin>
97template<
class T,
int SizeMin>
104template<
class T,
int SizeMin>
113 capacity_ =
max(SizeMin,
max(len, label(2*capacity_)));
121template<
class T,
int SizeMin>
124 auto& ptrs = this->ptrs_;
126 const label oldLen = ptrs.size();
128 if (capacity_ < newLen)
131 capacity_ =
max(SizeMin,
max(newLen, label(2*capacity_)));
135 else if (newLen != oldLen)
138 for (label i = newLen; i < oldLen; ++i)
150template<
class T,
int SizeMin>
153 (this->ptrs_).free();
158template<
class T,
int SizeMin>
166template<
class T,
int SizeMin>
178template<
class T,
int SizeMin>
182 if (currLen < capacity_)
193template<
class T,
int SizeMin>
202template<
class T,
int SizeMin>
203template<
int AnySizeMin>
222 std::swap(this->capacity_, other.capacity_);
226template<
class T,
int SizeMin>
227template<
class... Args>
234template<
class T,
int SizeMin>
237 const label idx = this->size();
239 this->ptrs_[idx] = ptr;
243template<
class T,
int SizeMin>
250template<
class T,
int SizeMin>
253 this->
append(ptr.release());
257template<
class T,
int SizeMin>
260 this->
append(ptr.release());
264template<
class T,
int SizeMin>
271template<
class T,
int SizeMin>
278template<
class T,
int SizeMin>
281 const label idx = this->size();
282 const label len = other.size();
286 for (label i = 0; i < len; ++i)
288 set(idx + i, other.release(i));
295template<
class T,
int SizeMin>
296template<
int AnySizeMin>
309 <<
"Attempted append to self"
313 const label idx = this->size();
314 const label len = other.size();
318 for (label i = 0; i < len; ++i)
320 set(idx + i, other.release(i));
323 other.clearStorage();
327template<
class T,
int SizeMin>
331 const label idx = (this->size() - 1);
339 this->ptrs_[idx] =
nullptr;
346template<
class T,
int SizeMin>
347template<
class... Args>
354 return this->set(i,
new T(std::forward<Args>(
args)...));
358template<
class T,
int SizeMin>
365 if (i >= this->size())
374template<
class T,
int SizeMin>
381 return this->set(i, ptr.
release());
385template<
class T,
int SizeMin>
392 return this->set(i, ptr.release());
396template<
class T,
int SizeMin>
400 std::unique_ptr<T>&& ptr
403 return this->set(i, ptr.release());
407template<
class T,
int SizeMin>
414 return this->set(i, ptr.
ptr());
418template<
class T,
int SizeMin>
425 return this->set(i, ptr.
ptr());
429template<
class T,
int SizeMin>
440template<
class T,
int SizeMin>
456template<
class T,
int SizeMin>
472template<
class T,
int SizeMin>
473template<
int AnySizeMin>
493template<
class T,
int SizeMin>
510template<
class T,
int SizeMin>
522 capacity_ = list.capacity();
527template<
class T,
int SizeMin>
528template<
int AnySizeMin>
544 capacity_ = list.capacity();
virtual bool resize()
Resize the ODE solver.
A dynamically resizable PtrList with allocation management.
void shrink()
Shrink the allocated space to the number of elements used.
constexpr PtrDynList() noexcept
Default construct.
void emplace_append(Args &&... args)
Construct and append an element to the end of the list.
autoPtr< T > remove()
Remove and return the top element.
void clearStorage()
Clear the list and delete storage.
label capacity() const noexcept
Size of the underlying storage.
label expandStorage() noexcept
Expand the addressable size to fit the allocated capacity.
void reorder(const labelUList &oldToNew)
Reorder elements. Reordering must be unique (ie, shuffle).
void reserve(const label len)
Reserve allocation space for at least this size.
autoPtr< T > emplace(const label i, Args &&... args)
Construct and set an element.
void clear()
Clear the addressed list, i.e. set the size to zero.
void swap(PtrDynList< T, AnySizeMin > &other)
Swap content, independent of sizing parameter.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void clear()
Clear the PtrList. Delete allocated entries and set size to zero.
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...
void setAddressableSize(const label n) noexcept
Set addressed size to be inconsistent with allocated storage.
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers...
void swap(UPtrList< T > &list)
Swap content.
label squeezeNull()
Squeeze out intermediate nullptr entries in the list of pointers.
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)
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.
rAUs append(new volScalarField(IOobject::groupName("rAU", phase1.name()), 1.0/(U1Eqn.A()+byDt(max(phase1.residualAlpha() - alpha1, scalar(0)) *rho1))))
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
errorManip< error > abort(error &err)
Foam::argList args(argc, argv)