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>
83 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
94 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
108 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
116 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
125 if (nextFree > capacity_)
128 nextFree = capacity_;
138 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
145 if (nElem > capacity_)
150 label(SizeInc + capacity_ * SizeMult / SizeDiv)
161 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
168 if (nElem > capacity_)
173 label(SizeInc + capacity_ * SizeMult / SizeDiv)
184 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
195 while (nextFree < nElem)
197 this->operator[](nextFree++) = t;
202 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
212 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
223 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
230 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
238 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
243 if (capacity_ > nextFree)
249 capacity_ = nextFree;
257 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
262 capacity_ = lst.
size();
267 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
275 capacity_ = lst.capacity_;
281 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
285 return xferMoveTo<List<T>>(*this);
289 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
299 this->operator[](elemI) = t;
304 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
322 this->operator[](nextFree++) = lst[elemI];
328 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
340 this->operator[](nextFree++) = lst[elemI];
346 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
367 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
378 return this->operator[](elemI);
382 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
383 inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
392 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
393 inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
404 if (capacity_ >= lst.
size())
421 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
422 inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
427 if (capacity_ >= lst.
size())
444 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
445 inline void Foam::DynamicList<T, SizeInc, SizeMult, SizeDiv>::operator=
450 if (capacity_ >= lst.
size())
469 template<
class T,
unsigned SizeInc,
unsigned SizeMult,
unsigned SizeDiv>
479 if (iter != this->end())
483 while (iter != this->end())
485 *nextIter++ = *iter++;
488 this->
setSize(this->size() - 1);
A simple container for copying or transferring objects of type <T>.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void resize(const label)
Alter the addressed list size.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
UList< T >::iterator erase(typename UList< T >::iterator)
Erase an element, move the remaining elements to fill the gap.
void size(const label)
Override size to be inconsistent with allocated storage.
T * iterator
Random access iterator for traversing UList.
void reserve(const label)
Reserve allocation space for at least this size.
points setSize(newPointi)
void setSize(const label)
Alter the addressed list size.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
DynamicList()
Construct null.
label size() const
Return the number of elements in the list.
void setCapacity(const label)
Alter the size of the underlying storage.
Xfer< List< T > > xfer()
Transfer contents to the Xfer container as a plain List.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManip< error > abort(error &err)
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
T remove()
Remove and return the top element.
A List with indirect addressing.
void clearStorage()
Clear the list and delete storage.
label capacity() const
Size of the underlying storage.
label size() const
Return the number of elements in the UList.
void clear()
Clear the addressed list, i.e. set the size to zero.
void transfer(List< T > &)
Transfer contents of the argument List into this.
friend Ostream & operator(Ostream &, const DynamicList< T, SizeInc, SizeMult, SizeDiv > &)