41 if (len == this->size_)
57 if (this->v_)
delete[] this->v_;
59 this->v_ =
new T[len];
69 if (is_contiguous<T>::value)
73 static_cast<void*>(nv), this->v_,
overlap*
sizeof(
T)
80 for (label i = 0; i <
overlap; ++i)
82 nv[i] = std::move(vp[i]);
112 UList<
T>(nullptr, len)
117 <<
"bad size " << len
128 UList<
T>(nullptr, len)
133 <<
"bad size " << len
142 for (label i=0; i < len; ++i)
153 UList<
T>(nullptr, len)
158 <<
"bad size " << len
167 for (label i=0; i < len; ++i)
189 this->v_[0] = std::move(val);
205 UList<
T>(nullptr, a.size_)
207 const label len = this->size_;
218 static_cast<void*>(this->v_), a.v_, this->size_bytes()
226 for (label i = 0; i < len; ++i)
238 UList<
T>(nullptr, a.size_)
240 const label len = this->size_;
247 if (is_contiguous<T>::value)
251 static_cast<void*>(this->v_), a.v_, this->size_bytes()
259 for (label i = 0; i < len; ++i)
271 UList<
T>(nullptr, a.size_)
282 const label len = this->size_;
289 if (is_contiguous<T>::value)
293 static_cast<void*>(this->v_), a.v_, this->size_bytes()
301 for (label i = 0; i < len; ++i)
313 UList<
T>(nullptr, indices.size())
315 const label len = indices.size();
323 for (label i=0; i < len; ++i)
325 vp[i] = list[indices[i]];
335 const UList<T>& list,
336 const FixedList<label,N>& indices
339 UList<
T>(nullptr, label(
N))
341 const label len = label(
N);
347 for (label i=0; i < len; ++i)
349 vp[i] = list[indices[i]];
358 UList<
T>(nullptr, label(
N))
368 UList<
T>(nullptr, list.size())
386 UList<
T>(nullptr, list.size())
411 template<
int SizeMin>
425 operator=(std::move(list));
446 label idx = this->size_;
468 this->size_ = list.size_;
477 template<
int SizeMin>
482 transfer(
static_cast<List<T>&
>(list));
501 const label len = this->size_;
506 if (is_contiguous<T>::value)
510 static_cast<void*>(this->v_), a.v_, this->size_bytes()
518 for (label i = 0; i < len; ++i)
535 operator=(
static_cast<const UList<T>&
>(list));
542 const label len = list.size();
550 for (
const T& val : list)
563 reAlloc(static_cast<label>(
N));
567 for (
const T& val : list)
579 const label len = list.size();
587 for (label i=0; i < len; ++i)
598 const label len = list.size();
606 for (
const T& val : list)
628 template<
int SizeMin>
638 label len = list.size();
642 for (
T* iter = this->
begin(); len--; ++iter)
644 *iter = std::move(list.removeHead());
668 const UList<T>& list,
676 template<
class T,
class ListComparePredicate>
679 const UList<T>& list,
681 const ListComparePredicate& comp
689 for (label& item : order)
#define List_CONST_ACCESS(type, f, fp)
void resize(const label len)
Adjust allocated size of list.
void transfer(List< T > &list)
Transfer the contents of the argument List into this list and annul the argument list.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
labelList sortedOrder(const UList< T > &input)
Return the (stable) sort order for the list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Template class for non-intrusive linked lists.
void resize_nocopy(const label len)
Adjust allocated size of list without necessarily.
void stableSort(UList< T > &list)
Stable sort the list.
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
Base for lists with indirect addressing, templated on the list contents type and the addressing type...
UList< label > labelUList
A UList of labels.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const cellCellStencilObject & overlap
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
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...
Macros for accessing List elements.
DynamicList< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
#define List_ACCESS(type, f, fp)
const Vector< label > N(dict.get< Vector< label >>("N"))
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers...
A template class to specify that a data type can be considered as being contiguous in memory...
void clearStorage()
Clear the list and delete storage.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
List< label > labelList
A List of labels.
Non-intrusive singly-linked list.
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
constexpr List() noexcept
Default construct.
A list compare binary predicate for normal sort.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
static constexpr const zero Zero
Global zero (0)