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 |
Default construct. 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 (const UList< T * > &list) | |
Construct from UList of pointers. 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... | |
T * | get (const label i) |
Return pointer to element (can be nullptr),. More... | |
const T * | get (const label i) const |
Return const pointer to element (can be nullptr),. More... | |
const T * | set (const label i) const |
Return const pointer to element (can be nullptr),. 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... | |
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 - same as get(). 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 62 of file UPtrList.H.
typedef T value_type |
Type of values the list contains.
Definition at line 91 of file UPtrList.H.
A non-const reference to the value_type.
Definition at line 94 of file UPtrList.H.
|
inlineprotected |
Low-level move construct.
Definition at line 46 of file UPtrListI.H.
|
inlineconstexprnoexcept |
Default construct.
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 (not the addresses) within the original list.
Definition at line 36 of file UPtrList.C.
Construct from UList of pointers.
Definition at line 74 of file UPtrListI.H.
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 81 of file UPtrListI.H.
|
inlinenoexcept |
The number of elements in the list.
Definition at line 97 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(), dynamicOversetFvMesh::updateAddressing(), and lduMatrix::updateMatrixInterfaces().
|
inlinenoexcept |
True if the list is empty (ie, size() is zero)
Definition at line 104 of file UPtrListI.H.
|
inline |
Return reference to the first element of the list.
Definition at line 146 of file UPtrListI.H.
|
inline |
Return reference to first element of the list.
Definition at line 153 of file UPtrListI.H.
|
inline |
Return reference to the last element of the list.
Definition at line 160 of file UPtrListI.H.
|
inline |
Return reference to the last element of the list.
Definition at line 167 of file UPtrListI.H.
|
inline |
Return pointer to element (can be nullptr),.
without bounds checking.
Definition at line 111 of file UPtrListI.H.
|
inline |
Return const pointer to element (can be nullptr),.
without bounds checking.
Definition at line 118 of file UPtrListI.H.
|
inline |
Return const pointer to element (can be nullptr),.
without bounds checking - same as get(). The return value can also be tested as a bool.
Definition at line 170 of file UPtrList.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().
|
inline |
Set list size to zero.
Definition at line 125 of file UPtrListI.H.
|
inline |
Reset size of list.
New entries are initialized to nullptr.
Definition at line 174 of file UPtrListI.H.
|
inline |
Same as resize()
Definition at line 181 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 188 of file UPtrListI.H.
Swap content.
Definition at line 132 of file UPtrListI.H.
Transfer contents into this list and annul the argument.
Definition at line 139 of file UPtrListI.H.
Referenced by wallDistData< TransferType >::correct(), meshWave::correct(), and directionalMeshWave::correct().
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 197 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 212 of file UPtrListI.H.
Return reference to the element.
Definition at line 229 of file UPtrListI.H.
Return const pointer to the element - same as get().
Definition at line 246 of file UPtrListI.H.
Copy assignment (shallow copies addresses)
Definition at line 663 of file UPtrListI.H.
Move assignment.
Definition at line 670 of file UPtrListI.H.
|
inline |
Return an iterator to begin traversing the UPtrList.
Definition at line 614 of file UPtrListI.H.
|
inline |
Return an iterator to end traversing the UPtrList.
Definition at line 622 of file UPtrListI.H.
|
inline |
Return an const_iterator to begin traversing the UPtrList.
Definition at line 630 of file UPtrListI.H.
|
inline |
Return an const_iterator to end traversing the UPtrList.
Definition at line 638 of file UPtrListI.H.
|
inline |
Return an const_iterator to begin traversing the UPtrList.
Definition at line 646 of file UPtrListI.H.
|
inline |
Return an const_iterator to end traversing the UPtrList.
Definition at line 654 of file UPtrListI.H.
const typedef T& const_reference |
A const reference to the value_type.
Definition at line 97 of file UPtrList.H.
|
protected |
The list of pointers.
Definition at line 77 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().