Go to the documentation of this file.
31 template<
class T,
int SizeMin>
32 template<
class ListType>
38 const label newSize = list.size();
40 if (capacity_ >= newSize)
43 Field<T>::size(list.size());
49 Field<T>::size(capacity_);
52 capacity_ = Field<T>::size();
59 template<
class T,
int SizeMin>
67 template<
class T,
int SizeMin>
71 capacity_(
Field<
T>::size())
77 template<
class T,
int SizeMin>
89 template<
class T,
int SizeMin>
101 template<
class T,
int SizeMin>
112 template<
class T,
int SizeMin>
113 template<
int AnySizeMin>
124 template<
class T,
int SizeMin>
135 template<
class T,
int SizeMin>
147 template<
class T,
int SizeMin>
158 template<
class T,
int SizeMin>
171 template<
class T,
int SizeMin>
172 template<
int AnySizeMin>
185 template<
class T,
int SizeMin>
197 template<
class T,
int SizeMin>
205 Field<T>(mapF, mapAddressing, weights),
211 template<
class T,
int SizeMin>
225 template<
class T,
int SizeMin>
232 template<
class T,
int SizeMin>
241 if (nextFree > capacity_)
244 nextFree = capacity_;
254 template<
class T,
int SizeMin>
261 if (nElem > capacity_)
282 template<
class T,
int SizeMin>
289 if (nElem > capacity_)
310 template<
class T,
int SizeMin>
321 while (nextFree < nElem)
323 this->operator[](nextFree++) = val;
328 template<
class T,
int SizeMin>
338 template<
class T,
int SizeMin>
349 template<
class T,
int SizeMin>
356 template<
class T,
int SizeMin>
364 template<
class T,
int SizeMin>
376 template<
class T,
int SizeMin>
381 if (capacity_ > nextFree)
387 capacity_ = nextFree;
395 template<
class T,
int SizeMin>
396 template<
int AnySizeMin>
426 template<
class T,
int SizeMin>
430 capacity_ = list.size();
435 template<
class T,
int SizeMin>
436 template<
int AnySizeMin>
451 template<
class T,
int SizeMin>
452 template<
int AnySizeMin>
472 template<
class T,
int SizeMin>
482 this->operator[](idx) = val;
487 template<
class T,
int SizeMin>
503 for (
const T& val : list)
505 this->operator[](idx++) = val;
511 template<
class T,
int SizeMin>
533 template<
class T,
int SizeMin>
544 return this->operator[](i);
548 template<
class T,
int SizeMin>
558 template<
class T,
int SizeMin>
564 assignDynField(list);
568 template<
class T,
int SizeMin>
579 assignDynField(list);
583 template<
class T,
int SizeMin>
593 template<
class T,
int SizeMin>
603 template<
class T,
int SizeMin>
604 template<
int AnySizeMin>
void clear()
Clear the addressed list, i.e. set the size to zero.
points setSize(newPointi)
void transfer(List< T > &list)
Transfer the parameter contents into this.
void setSize(const label nElem)
Alter the addressed list size.
void clearStorage()
Clear the list and delete storage.
static constexpr const zero Zero
Global zero (0)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
label capacity() const noexcept
Size of the underlying storage.
label expandStorage()
Expand the addressable size to fit the allocated capacity.
Abstract base class to hold the Field mapping addressing and weights.
label capacity() const noexcept
Size of the underlying storage.
DynamicField< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
Generic templated field type.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
constexpr DynamicField() noexcept
Construct null.
void swap(DynamicField< T, AnySizeMin > &list)
Swap content with any sized DynamicField.
errorManip< error > abort(error &err)
void operator=(const Field< T > &)
Copy assignment.
void setSize(const label nElem)
Alter addressable list size.
void setCapacity(const label nElem)
Alter the size of the underlying storage.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
void reserve(const label nElem)
Reserve allocation space for at least this size.
T remove()
Remove and return the top element.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
label expandStorage()
Expand the addressable size to fit the allocated capacity.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void clearStorage()
Clear the list and delete storage.
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
void setCapacity(const label nElem)
Alter the size of the underlying storage.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
DynamicField< T, SizeMin > & append(const T &val)
Append an element at the end of the list.
void resize(const label nElem)
Alter the addressed list size.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...