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) |
const T * | get (const label i) const |
const T * | set (const label i) const |
void | clear () |
Set list size to zero. More... | |
void | resize (const label newLen) |
Change the size of the list. More... | |
void | setSize (const label n) |
Alias for 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 () noexcept |
Return an iterator to begin traversing the UPtrList. More... | |
iterator | end () noexcept |
Return an iterator to end traversing the UPtrList. More... | |
const_iterator | cbegin () const noexcept |
Return an const_iterator to begin traversing the UPtrList. More... | |
const_iterator | cend () const noexcept |
Return an const_iterator to end traversing the UPtrList. More... | |
const_iterator | begin () const noexcept |
Return an const_iterator to begin traversing the UPtrList. More... | |
const_iterator | end () const noexcept |
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 | |
void | setAddressableSize (const label n) noexcept |
Adjust addressable size. More... | |
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 97 of file UPtrList.H.
A non-const reference to the value_type.
Definition at line 100 of file UPtrList.H.
|
inlineexplicitprotected |
Low-level move construct.
Definition at line 55 of file UPtrListI.H.
|
inlineconstexprnoexcept |
Default construct.
Definition at line 41 of file UPtrListI.H.
|
inlineexplicit |
Construct with specified size, each element initialized to nullptr.
Definition at line 48 of file UPtrListI.H.
Copy construct (shallow copies addresses)
Definition at line 62 of file UPtrListI.H.
Move construct.
Definition at line 69 of file UPtrListI.H.
Construct as shallow copy or re-use as specified.
Definition at line 76 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 83 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 90 of file UPtrListI.H.
|
inlineprotectednoexcept |
Adjust addressable size.
Definition at line 32 of file UPtrListI.H.
|
inlinenoexcept |
The number of elements in the list.
Definition at line 106 of file UPtrListI.H.
Referenced by fvMeshAdder::add(), dynamicOversetFvMesh::addInterpolation(), GAMGAgglomeration::agglomerateLduAddressing(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), GAMGProcAgglomeration::globalCellCells(), lduPrimitiveMesh::globalCellCells(), hexRef8Data::hexRef8Data(), lduMatrix::initMatrixInterfaces(), lduPrimitiveMesh::lduPrimitiveMesh(), Foam::MULES::limitSum(), lduPrimitiveMesh::nonBlockingSchedule(), faMeshLduAddressing::nPatches(), Foam::operator<<(), foamToVtkReportFields::print(), refinementHistory::refinementHistory(), Foam::shuffle(), dynamicOversetFvMesh::updateAddressing(), and lduMatrix::updateMatrixInterfaces().
|
inlinenoexcept |
True if the list is empty (ie, size() is zero)
Definition at line 113 of file UPtrListI.H.
|
inline |
Return reference to the first element of the list.
Definition at line 155 of file UPtrListI.H.
|
inline |
Return reference to first element of the list.
Definition at line 162 of file UPtrListI.H.
|
inline |
Return reference to the last element of the list.
Definition at line 169 of file UPtrListI.H.
|
inline |
Return reference to the last element of the list.
Definition at line 176 of file UPtrListI.H.
|
inline |
Return pointer to element (can be nullptr), without bounds checking.
Definition at line 120 of file UPtrListI.H.
Referenced by fvMeshAdder::add().
|
inline |
Return const pointer to element (can be nullptr), without bounds checking.
Definition at line 127 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 176 of file UPtrList.H.
Referenced by fvMeshAdder::add(), GAMGAgglomeration::agglomerateLduAddressing(), GAMGAgglomeration::combineLevels(), fvMatrix< Type >::createOrUpdateLduPrimitiveAssembly(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), GAMGProcAgglomeration::globalCellCells(), lduPrimitiveMesh::globalCellCells(), lduMatrix::initMatrixInterfaces(), lduPrimitiveMesh::lduPrimitiveMesh(), nonBlockingGaussSeidelSmoother::nonBlockingGaussSeidelSmoother(), lduPrimitiveMesh::nonBlockingSchedule(), Foam::operator<<(), procLduMatrix::procLduMatrix(), GeometricField< Type, PatchField, GeoMesh >::Boundary::scalarInterfaces(), fvMatrix< Type >::setInterfaces(), lduMatrix::sumA(), lduPrimitiveMeshAssembly::update(), dynamicOversetFvMesh::updateAddressing(), lduMatrix::updateMatrixInterfaces(), and dynamicOversetFvMesh::write().
|
inline |
Set list size to zero.
Definition at line 134 of file UPtrListI.H.
|
inline |
Change the size of the list.
New entries are initialized to nullptr.
Definition at line 183 of file UPtrListI.H.
Referenced by UPtrList< const Foam::UList >::setSize().
|
inline |
Alias for resize()
Definition at line 189 of file UPtrList.H.
Referenced by fvMatrix< Type >::setInterfaces(), and 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 190 of file UPtrListI.H.
Swap content.
Definition at line 141 of file UPtrListI.H.
Transfer contents into this list and annul the argument.
Definition at line 148 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 199 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 214 of file UPtrListI.H.
Return reference to the element.
Definition at line 231 of file UPtrListI.H.
Return const pointer to the element - same as get().
Definition at line 248 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.
|
inlinenoexcept |
Return an iterator to begin traversing the UPtrList.
Definition at line 600 of file UPtrListI.H.
|
inlinenoexcept |
Return an iterator to end traversing the UPtrList.
Definition at line 608 of file UPtrListI.H.
|
inlinenoexcept |
Return an const_iterator to begin traversing the UPtrList.
Definition at line 616 of file UPtrListI.H.
|
inlinenoexcept |
Return an const_iterator to end traversing the UPtrList.
Definition at line 624 of file UPtrListI.H.
|
inlinenoexcept |
Return an const_iterator to begin traversing the UPtrList.
Definition at line 632 of file UPtrListI.H.
|
inlinenoexcept |
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 103 of file UPtrList.H.
|
protected |
The list of pointers.
Definition at line 77 of file UPtrList.H.
Referenced by UPtrList< const Foam::UList >::begin(), UPtrList< const Foam::UList >::cbegin(), UPtrList< const Foam::UList >::cend(), UPtrList< const Foam::UList >::end(), UPtrList< const Foam::UList >::operator=(), UPtrList< const Foam::UList >::swap(), and UPtrList< const Foam::UList >::transfer().