A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers - this is to be done elsewhere. The operator[] returns a reference to the object, not the pointer. More...
Classes | |
class | const_iterator |
Random-access iterator with const access. More... | |
class | iterator |
Random-access iterator with non-const access. More... | |
Public Types | |
typedef T | value_type |
Type of values the list contains. More... | |
typedef T & | reference |
A non-const reference to the value_type. More... | |
Public Member Functions | |
constexpr | UPtrList () noexcept |
Construct null. More... | |
UPtrList (const label len) | |
Construct with specified size, each element initialized to nullptr. More... | |
UPtrList (const UPtrList< T > &list) | |
Copy construct (shallow copies addresses) More... | |
UPtrList (UPtrList< T > &&list) | |
Move construct. More... | |
UPtrList (UPtrList< T > &list, bool reuse) | |
Construct as shallow copy or re-use as specified. More... | |
UPtrList (PtrList< T > &list) | |
Shallow copy from PtrList. More... | |
UPtrList (UList< T > &list) | |
Construct from UList, taking the address of each list element. More... | |
label | size () const noexcept |
The number of elements in the list. More... | |
bool | empty () const noexcept |
True if the list is empty (ie, size() is zero) More... | |
T & | first () |
Return reference to the first element of the list. More... | |
const T & | first () const |
Return reference to first element of the list. More... | |
T & | last () |
Return reference to the last element of the list. More... | |
const T & | last () const |
Return reference to the last element of the list. More... | |
void | clear () |
Set list size to zero. More... | |
void | resize (const label newLen) |
Reset size of list. More... | |
void | setSize (const label newLen) |
Same as resize() More... | |
label | squeezeNull () |
Squeeze out intermediate nullptr entries in the list of pointers. More... | |
void | append (T *ptr) |
Append an element to the end of the list. More... | |
void | swap (UPtrList< T > &list) |
Swap content. More... | |
void | transfer (UPtrList< T > &list) |
Transfer contents into this list and annul the argument. More... | |
const T * | set (const label i) const |
Return const pointer to element (if set) or nullptr. More... | |
T * | set (const label i, T *ptr) |
void | reorder (const labelUList &oldToNew, const bool testNull=true) |
void | sortOrder (const labelUList &order, const bool testNull=true) |
const T & | operator[] (const label i) const |
Return const reference to the element. More... | |
T & | operator[] (const label i) |
Return reference to the element. More... | |
const T * | operator() (const label i) const |
Return const pointer to the element. More... | |
void | operator= (const UPtrList< T > &list) |
Copy assignment (shallow copies addresses) More... | |
void | operator= (UPtrList< T > &&list) |
Move assignment. More... | |
iterator | begin () |
Return an iterator to begin traversing the UPtrList. More... | |
iterator | end () |
Return an iterator to end traversing the UPtrList. More... | |
const_iterator | cbegin () const |
Return an const_iterator to begin traversing the UPtrList. More... | |
const_iterator | cend () const |
Return an const_iterator to end traversing the UPtrList. More... | |
const_iterator | begin () const |
Return an const_iterator to begin traversing the UPtrList. More... | |
const_iterator | end () const |
Return an const_iterator to end traversing the UPtrList. More... | |
Public Attributes | |
const typedef T & | const_reference |
A const reference to the value_type. More... | |
Protected Member Functions | |
UPtrList (Detail::PtrListDetail< T > &&ptrs) | |
Low-level move construct. More... | |
Protected Attributes | |
Detail::PtrListDetail< T > | ptrs_ |
The list of pointers. More... | |
Friends | |
Ostream & | operator (Ostream &os, const UPtrList< T > &list) |
Write UPtrList to Ostream. More... | |
A list of pointers to objects of type <T>, without allocation/deallocation management of the pointers - this is to be done elsewhere. The operator[] returns a reference to the object, not the pointer.
Definition at line 63 of file UPtrList.H.
typedef T value_type |
Type of values the list contains.
Definition at line 94 of file UPtrList.H.
A non-const reference to the value_type.
Definition at line 97 of file UPtrList.H.
|
inlineprotected |
Low-level move construct.
Definition at line 46 of file UPtrListI.H.
|
inlineconstexprnoexcept |
Construct null.
Definition at line 32 of file UPtrListI.H.
|
inlineexplicit |
Construct with specified size, each element initialized to nullptr.
Definition at line 39 of file UPtrListI.H.
Copy construct (shallow copies addresses)
Definition at line 53 of file UPtrListI.H.
Move construct.
Definition at line 60 of file UPtrListI.H.
Construct as shallow copy or re-use as specified.
Definition at line 67 of file UPtrListI.H.
Shallow copy from PtrList.
The argument is non-const to reflect that the UPtrList can change the values (but not the addresses) of the original list.
Definition at line 36 of file UPtrList.C.
Construct from UList, taking the address of each list element.
The argument is non-const to reflect that the UPtrList can change the values of the original list.
Definition at line 74 of file UPtrListI.H.
|
inlinenoexcept |
The number of elements in the list.
Definition at line 90 of file UPtrListI.H.
Referenced by dynamicOversetFvMesh::addInterpolation(), GAMGAgglomeration::agglomerateLduAddressing(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), GAMGProcAgglomeration::globalCellCells(), hexRef8Data::hexRef8Data(), lduMatrix::initMatrixInterfaces(), lduPrimitiveMesh::lduPrimitiveMesh(), Foam::MULES::limitSum(), lduPrimitiveMesh::nonBlockingSchedule(), Foam::operator<<(), foamToVtkReportFields::print(), refinementHistory::refinementHistory(), Foam::shuffle(), Foam::sort(), Foam::sortedOrder(), dynamicOversetFvMesh::updateAddressing(), and lduMatrix::updateMatrixInterfaces().
|
inlinenoexcept |
True if the list is empty (ie, size() is zero)
Definition at line 97 of file UPtrListI.H.
|
inline |
Return reference to the first element of the list.
Definition at line 125 of file UPtrListI.H.
|
inline |
Return reference to first element of the list.
Definition at line 132 of file UPtrListI.H.
|
inline |
Return reference to the last element of the list.
Definition at line 139 of file UPtrListI.H.
|
inline |
Return reference to the last element of the list.
Definition at line 146 of file UPtrListI.H.
|
inline |
Set list size to zero.
Definition at line 104 of file UPtrListI.H.
|
inline |
Reset size of list.
New entries are initialized to nullptr.
Definition at line 153 of file UPtrListI.H.
|
inline |
Same as resize()
Definition at line 160 of file UPtrListI.H.
Referenced by dynamicOversetFvMesh::updateAddressing().
Foam::label squeezeNull | ( | ) |
Squeeze out intermediate nullptr entries in the list of pointers.
Definition at line 45 of file UPtrList.C.
|
inline |
Append an element to the end of the list.
Definition at line 167 of file UPtrListI.H.
Swap content.
Definition at line 111 of file UPtrListI.H.
Transfer contents into this list and annul the argument.
Definition at line 118 of file UPtrListI.H.
Referenced by wallDistData< TransferType >::correct(), meshWave::correct(), and directionalMeshWave::correct().
|
inline |
Return const pointer to element (if set) or nullptr.
The return value can be tested as a bool.
Definition at line 176 of file UPtrListI.H.
Referenced by GAMGAgglomeration::agglomerateLduAddressing(), GAMGAgglomeration::combineLevels(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), GAMGProcAgglomeration::globalCellCells(), lduMatrix::initMatrixInterfaces(), fvBoundaryMesh::interfaces(), faBoundaryMesh::interfaces(), lduPrimitiveMesh::lduPrimitiveMesh(), nonBlockingGaussSeidelSmoother::nonBlockingGaussSeidelSmoother(), lduPrimitiveMesh::nonBlockingSchedule(), Foam::operator<<(), procLduMatrix::procLduMatrix(), GeometricField< Type, PatchField, GeoMesh >::Boundary::scalarInterfaces(), lduMatrix::sumA(), dynamicOversetFvMesh::updateAddressing(), lduMatrix::updateMatrixInterfaces(), and dynamicOversetFvMesh::write().
Set element to specified pointer and return the old list element, which can be a nullptr.
No-op if the new pointer value is identical to the current content.
Definition at line 183 of file UPtrListI.H.
void reorder | ( | const labelUList & | oldToNew, |
const bool | testNull = true |
||
) |
Reorder elements. Reordering must be unique (ie, shuffle).
Optionally verify that all pointers have been set.
Definition at line 70 of file UPtrList.C.
void sortOrder | ( | const labelUList & | order, |
const bool | testNull = true |
||
) |
Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle).
Optionally verify that all pointers have been set.
Definition at line 129 of file UPtrList.C.
Referenced by Foam::shuffle(), and Foam::sort().
Return const reference to the element.
Definition at line 198 of file UPtrListI.H.
Return reference to the element.
Definition at line 215 of file UPtrListI.H.
Return const pointer to the element.
Definition at line 232 of file UPtrListI.H.
Copy assignment (shallow copies addresses)
Definition at line 649 of file UPtrListI.H.
Move assignment.
Definition at line 656 of file UPtrListI.H.
|
inline |
Return an iterator to begin traversing the UPtrList.
Definition at line 600 of file UPtrListI.H.
|
inline |
Return an iterator to end traversing the UPtrList.
Definition at line 608 of file UPtrListI.H.
|
inline |
Return an const_iterator to begin traversing the UPtrList.
Definition at line 616 of file UPtrListI.H.
|
inline |
Return an const_iterator to end traversing the UPtrList.
Definition at line 624 of file UPtrListI.H.
|
inline |
Return an const_iterator to begin traversing the UPtrList.
Definition at line 632 of file UPtrListI.H.
|
inline |
Return an const_iterator to end traversing the UPtrList.
Definition at line 640 of file UPtrListI.H.
const typedef T& const_reference |
A const reference to the value_type.
Definition at line 100 of file UPtrList.H.
|
protected |
The list of pointers.
Definition at line 80 of file UPtrList.H.
Referenced by UPtrList< Foam::diameterModels::velocityGroup >::begin(), UPtrList< Foam::diameterModels::velocityGroup >::cbegin(), UPtrList< Foam::diameterModels::velocityGroup >::cend(), UPtrList< Foam::diameterModels::velocityGroup >::end(), UPtrList< Foam::diameterModels::velocityGroup >::operator=(), UPtrList< Foam::diameterModels::velocityGroup >::swap(), and UPtrList< Foam::diameterModels::velocityGroup >::transfer().