Go to the documentation of this file.
45 <<
"bad size " << newSize
49 if (newSize != this->size_)
53 T* nv =
new T[newSize];
55 const label
overlap =
min(this->size_, newSize);
60 if (is_contiguous<T>::value)
64 static_cast<void*
>(nv), this->v_,
overlap*
sizeof(
T)
72 for (label i = 0; i <
overlap; ++i)
74 nv[i] = std::move(vp[i]);
80 this->size_ = newSize;
101 <<
"bad size " << len
117 <<
"bad size " << len
126 for (label i=0; i < len; ++i)
142 <<
"bad size " << len
151 for (label i=0; i < len; ++i)
173 this->v_[0] = std::move(val);
189 UList<
T>(nullptr, a.size_)
191 const label len = this->size_;
202 static_cast<void*
>(this->v_), a.v_, this->byteSize()
210 for (label i = 0; i < len; ++i)
222 UList<
T>(nullptr, a.size_)
224 const label len = this->size_;
235 static_cast<void*
>(this->v_), a.v_, this->byteSize()
243 for (label i = 0; i < len; ++i)
255 UList<
T>(nullptr, a.size_)
266 const label len = this->size_;
277 static_cast<void*
>(this->v_), a.v_, this->byteSize()
285 for (label i = 0; i < len; ++i)
297 UList<
T>(nullptr, indices.size())
299 const label len = indices.
size();
307 for (label i=0; i < len; ++i)
309 vp[i] = list[indices[i]];
325 const label len = label(
N);
331 for (label i=0; i < len; ++i)
333 vp[i] = list[indices[i]];
339 template<
class InputIterator>
360 UList<
T>(nullptr, list.size())
378 UList<
T>(nullptr, list.size())
403 template<
int SizeMin>
426 operator=(std::move(list));
447 const label oldSize = this->size_;
448 this->doResize(newSize);
451 for (label i = oldSize; i < newSize; ++i)
468 this->size_ = list.size_;
477 template<
int SizeMin>
482 transfer(
static_cast<List<T>&
>(list));
494 transfer(
static_cast<List<T>&
>(list));
510 const label len = this->size_;
519 static_cast<void*
>(this->v_), a.v_, this->byteSize()
527 for (label i = 0; i < len; ++i)
544 operator=(
static_cast<const UList<T>&
>(list));
551 const label len = list.size();
559 for (
const T& val : list)
576 for (
const T& val : list)
588 const label len = list.
size();
596 for (label i=0; i < len; ++i)
607 const label len = list.size();
615 for (
const T& val : list)
637 template<
int SizeMin>
654 label len = list.
size();
662 *iter = std::move(list.removeHead());
constexpr auto begin(C &c) -> decltype(c.begin())
Return iterator to the beginning of the container c.
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.
A class representing the concept of 1 (one) that can be used to avoid manipulating objects known to b...
DynamicList< T, SizeMin > & shrink()
Shrink the allocated space to the number of elements used.
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Template class for non-intrusive linked lists.
void transfer(List< T > &list)
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
void operator=(const UList< T > &a)
Assignment to UList operator. Takes linear time.
void resize(const label newSize)
Adjust allocated size of list.
List< T > & shrink()
Clear the indices and return a reference to the underlying List.
A list that is sorted upon construction or when explicitly requested with the sort() method.
constexpr auto end(C &c) -> decltype(c.end())
Return iterator to the end of the container c.
errorManip< error > abort(error &err)
constexpr List() noexcept
Null constructor.
scalar distance(const vector &p1, const vector &p2)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
#define List_CONST_ACCESS(type, f, fp)
Non-intrusive singly-linked list.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
A 1D vector of objects of type <T> with a fixed length <N>.
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.
Base for lists with indirect addressing, templated on the list contents type and the addressing type....
const cellCellStencilObject & overlap
const Vector< label > N(dict.get< Vector< label >>("N"))
#define List_ACCESS(type, f, fp)
label size() const
The number of elements in the list.
A template class to specify that a data type can be considered as being contiguous in memory.
Macros for accessing List elements.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...