28 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
35 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
49 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
61 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
72 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
79 capacity_(lst.capacity_)
85 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
96 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
103 capacity_(lst.size())
107 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
120 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
128 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
137 if (nextFree > capacity_)
140 nextFree = capacity_;
150 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
157 if (nElem > capacity_)
162 label(SizeInc + capacity_ * SizeMult / SizeDiv)
173 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
180 if (nElem > capacity_)
185 label(SizeInc + capacity_ * SizeMult / SizeDiv)
196 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
207 while (nextFree < nElem)
209 this->operator[](nextFree++) = t;
214 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
224 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
235 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
242 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
250 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
255 if (capacity_ > nextFree)
261 capacity_ = nextFree;
269 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
277 capacity_ = lst.capacity_;
283 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
288 capacity_ = lst.
size();
293 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
303 this->operator[](elemI) = t;
308 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
326 this->operator[](nextFree++) = lst[elemI];
332 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
344 this->operator[](nextFree++) = lst[elemI];
350 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
371 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
382 return this->operator[](elemI);
386 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
396 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
408 if (capacity_ >= lst.size())
425 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
438 capacity_ = lst.capacity_;
443 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
460 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
466 if (capacity_ >= lst.size())
483 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
489 if (capacity_ >= lst.size())
508 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
518 if (iter != this->end())
522 while (iter != this->end())
524 *nextIter++ = *iter++;
527 this->
setSize(this->size() - 1);
#define forAll(list, i)
Loop across all elements in list.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
T remove()
Remove and return the top element.
friend Ostream & operator(Ostream &, const DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
void transfer(List< T > &)
Transfer contents of the argument List into this.
void setCapacity(const label)
Alter the size of the underlying storage.
void resize(const label)
Alter the addressed list size.
label capacity() const
Size of the underlying storage.
void reserve(const label)
Reserve allocation space for at least this size.
void clearStorage()
Clear the list and delete storage.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
DynamicList()
Construct null.
void clear()
Clear the addressed list, i.e. set the size to zero.
UList< T >::iterator erase(typename UList< T >::iterator)
Erase an element, move the remaining elements to fill the gap.
void setSize(const label)
Alter the addressed list size.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
label size() const
Return the number of elements in the UList.
void size(const label)
Override size to be inconsistent with allocated storage.
void clear()
Clear the list, i.e. set size to zero.
void operator=(const UList< T > &)
Assignment to UList operator. Takes linear time.
void setSize(const label)
Reset size of List.
A List with indirect addressing.
label size() const
Return the number of elements in the list.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
T * iterator
Random access iterator for traversing UList.
label size() const
Return the number of elements in the UList.
T & operator[](const label)
Return element of UList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManip< error > abort(error &err)
layerAndWeight max(const layerAndWeight &a, const layerAndWeight &b)
void T(FieldField< Field, Type > &f1, const FieldField< Field, Type > &f2)
points setSize(newPointi)