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...
#include <UPtrList.H>
Inherited by PtrList< faPatch >, PtrList< fvPatch >, PtrList< blockEdge >, PtrList< blockFace >, PtrList< block >, PtrList< blockVertex >, PtrList< pointPatch >, PtrList< polyPatch >, and PtrList< T >.
Classes | |
| struct | value_compare |
| A wrapper for a binary comparison of values that interjects pointer dereferencing with null pointer guards. More... | |
| struct | less |
| A UPtrList compare binary predicate for normal sort order. Null entries (if any) sort to the end. More... | |
| struct | greater |
| A UPtrList compare binary predicate for reverse sort order. More... | |
| class | Iterator |
| Internally used base for iterator and const_iterator. More... | |
| class | iterator |
| Forward iterator with non-const access. More... | |
| class | const_iterator |
| Forward iterator with const access. More... | |
Public Types | |
| typedef T | value_type |
| Type of values the list contains. | |
| typedef T & | reference |
| A non-const reference to the value_type. | |
| typedef const T & | const_reference |
| A const reference to the value_type. | |
Public Member Functions | |
| constexpr | UPtrList () noexcept=default |
| Default construct. | |
| UPtrList (const label len) | |
Construct with specified size and set all entries to nullptr. | |
| UPtrList (const UPtrList< T > &list) | |
| Copy construct (shallow copies addresses). | |
| UPtrList (UPtrList< T > &&list) noexcept | |
| Move construct. | |
| UPtrList (UPtrList< T > &list, bool reuse) | |
| Construct as shallow copy or re-use as specified. | |
| UPtrList (PtrList< T > &list) | |
| Shallow copy from PtrList. | |
| UPtrList (const UList< T * > &list) | |
| Construct from UList of pointers (shallow copy). | |
| UPtrList (UList< T > &list) | |
| Construct from UList, taking the address of each list element. | |
| bool | empty () const noexcept |
| True if the list is empty (ie, size() is zero). | |
| label | size () const noexcept |
| The number of entries in the list. | |
| label | capacity () const noexcept |
| Size of the underlying storage. | |
| label | count_nonnull () const noexcept |
| The number of non-nullptr entries in the list. | |
| T & | front () |
| Reference to the first element of the list. | |
| const T & | front () const |
| Reference to first element of the list. | |
| T & | back () |
| Reference to the last element of the list. | |
| const T & | back () const |
| Reference to the last element of the list. | |
| const T * | test (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| const T * | get (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| T * | get (const label i) |
| Return pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| const T * | set (const label i) const |
| Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). | |
| void | clear () |
| Set list size to zero. | |
| void | free () |
| Nullify all entries. Does not change the list size. | |
| void | resize (const label newLen) |
Change the size of the list. Any new entries are nullptr. | |
| void | resize_null (const label newLen) |
Set the list to the given size and set all entries to nullptr. | |
| label | squeezeNull () |
| Squeeze out nullptr entries in the list of pointers after which any null pointers will be at the end of the list. | |
| void | push_back (T *ptr) |
| Append an element to the end of the list. | |
| void | push_back (UPtrList< T > &&other) |
| Move append another list to the end of this list. | |
| void | swap (UPtrList< T > &list) noexcept |
| Swap content. | |
| void | transfer (UPtrList< T > &list) |
| Transfer contents into this list and annul the argument. | |
| T * | set (const label i, T *ptr) |
| Set element to specified pointer and return the old list element, which can be a nullptr. | |
| void | reorder (const labelUList &oldToNew, const bool check=false) |
| Reorder elements. Reordering must be unique (ie, shuffle). | |
| void | sortOrder (const labelUList &order, const bool check=false) |
| Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle). | |
| void | checkNonNull () const |
| Check and raise FatalError if any nullptr exists in the list. | |
| const T & | at (const label i) const |
| Return const reference to the element at given position. FatalError for bounds problem or nullptr. | |
| T & | at (const label i) |
| Return reference to the element at given position. FatalError for bounds problem or nullptr. | |
| const T & | operator[] (const label i) const |
| Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at(). | |
| T & | operator[] (const label i) |
| Return reference to the element at given position. FatalError for bounds problem or nullptr. Same as at(). | |
| FOAM_DEPRECATED_FOR (2022-09, "get(), set() or test() methods") const T *operator()(const label i) const | |
| Deprecated(2022-09) - same as get(). | |
| void | operator= (const UPtrList< T > &list) |
| Copy assignment (shallow copies addresses). | |
| void | operator= (UPtrList< T > &&list) |
| Move assignment. | |
| Ostream & | printAddresses (Ostream &os) const |
| Print pointer addresses to Ostream (debugging only). | |
| Ostream & | writeList (Ostream &os, const bool trimNull=false) const |
| Write UPtrList to Ostream, optionally ignoring null entries. | |
| T ** | begin_ptr () noexcept |
| Iterator to begin of raw pointers traversal (use with caution). | |
| T ** | end_ptr () noexcept |
| Iterator beyond end of raw pointers traversal (use with caution). | |
| iterator | begin () |
| Return iterator to begin traversal of non-nullptr entries. | |
| iterator | end () noexcept |
| Return iterator beyond end of UPtrList traversal. | |
| const_iterator | cbegin () const |
| Return const_iterator to begin traversal of non-nullptr entries. | |
| const_iterator | cend () const noexcept |
| Return const_iterator beyond end of UPtrList traversal. | |
| const_iterator | begin () const |
| Return const_iterator to begin traversal of non-nullptr entries. | |
| const_iterator | end () const noexcept |
| Return const_iterator beyond end of UPtrList traversal. | |
| void | setSize (const label n) |
| Alias for resize(). | |
| T & | first () |
| Reference to the first element of the list. | |
| const T & | first () const |
| Return reference to first element of the list. | |
| T & | last () |
| Return reference to the last element of the list. | |
| const T & | last () const |
| Return reference to the last element of the list. | |
| void | append (T *ptr) |
| Append an element to the end of the list. | |
| void | append (UPtrList< T > &&other) |
| Move append another list to the end of this list. | |
| label | count () const noexcept |
| The number of non-nullptr entries in the list. | |
Protected Member Functions | |
| void | setAddressableSize (const label n) noexcept |
| Adjust addressable size. | |
| label | find_next (label pos) const |
| The next non-null entry after the specified position. | |
| UPtrList (Detail::PtrListDetail< T > &&ptrs) noexcept | |
| Low-level move construct. | |
Protected Attributes | |
| Detail::PtrListDetail< T > | ptrs_ |
| The list of pointers. | |
Friends | |
| class | Iterator< true > |
| Allow iterator access to internals. | |
| class | Iterator< false > |
| Allow iterator access to internals. | |
| Ostream & | operator<< (Ostream &os, const UPtrList< T > &list) |
| Write UPtrList to Ostream. Does not ignore null entries. | |
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).
The iterators are similar to bitSet in that they skip nullptr entries, and also return a value (like the list operator[] does).
When traversing lists, it possible to test the validity directly:
The lists can also be traversed with a for-range (in OpenFOAM-v2212 and earlier this would have failed on nullptr entries):
It is also possible to traverse with non-null entries and use key/val access (like HashTable naming):
Definition at line 100 of file UPtrList.H.
| typedef T value_type |
Type of values the list contains.
Definition at line 140 of file UPtrList.H.
A non-const reference to the value_type.
Definition at line 145 of file UPtrList.H.
| typedef const T& const_reference |
A const reference to the value_type.
Definition at line 150 of file UPtrList.H.
|
inlineexplicitprotectednoexcept |
Low-level move construct.
Definition at line 48 of file UPtrListI.H.
References Foam::noexcept, and ptrs_.
Referenced by UPtrList< T >::greater::greater(), UPtrList< T >::less::less(), PtrList< T >::operator=(), PtrList< faPatch >::operator=(), operator=(), operator=(), PtrList< T >::PtrList(), PtrList< T >::PtrList(), PtrList< T >::PtrList(), PtrList< T >::PtrList(), PtrList< T >::PtrList(), PtrList< T >::PtrList(), PtrList< T >::PtrList(), PtrList< T >::PtrList(), push_back(), swap(), transfer(), UPtrList(), UPtrList(), and UPtrList().

|
constexprdefaultnoexcept |
Default construct.
|
inlineexplicit |
Construct with specified size and set all entries to nullptr.
Definition at line 41 of file UPtrListI.H.
References ptrs_.
Copy construct (shallow copies addresses).
Definition at line 55 of file UPtrListI.H.
References ptrs_, and UPtrList().

Move construct.
Definition at line 62 of file UPtrListI.H.
References Foam::noexcept, ptrs_, and UPtrList().

Construct as shallow copy or re-use as specified.
Definition at line 69 of file UPtrListI.H.
References ptrs_, and UPtrList().

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 29 of file UPtrList.C.
References ptrs_.
Construct from UList of pointers (shallow copy).
Definition at line 76 of file UPtrListI.H.
References ptrs_.
|
inlineprotectednoexcept |
Adjust addressable size.
Definition at line 25 of file UPtrListI.H.
Referenced by PtrDynList< T, SizeMin >::clearStorage(), PtrDynList< T, SizeMin >::PtrDynList(), PtrDynList< Foam::Field< label > >::push_back(), PtrDynList< T, SizeMin >::reserve(), PtrDynList< T, SizeMin >::resize_null(), PtrDynList< T, SizeMin >::squeezeNull(), PtrDynList< T, SizeMin >::transfer(), PtrDynList< Foam::Field< label > >::transfer(), and PtrDynList< T, SizeMin >::~PtrDynList().

|
inlineprotected |
The next non-null entry after the specified position.
Definition at line 32 of file UPtrListI.H.
References Foam::pos(), and ptrs_.

|
inlinenoexcept |
True if the list is empty (ie, size() is zero).
Definition at line 99 of file UPtrListI.H.
References Foam::noexcept, and ptrs_.
Referenced by forces::calcForcesMoments(), injectionModelList::correct(), List< T >::List(), Foam::redistributeLagrangian(), faBoundaryMeshEntries::writeEntries(), polyBoundaryMeshEntries::writeEntries(), faBoundaryMesh::writeEntry(), faBoundaryMesh::writeEntry(), faBoundaryMeshEntries::writeEntry(), polyBoundaryMesh::writeEntry(), polyBoundaryMesh::writeEntry(), polyBoundaryMeshEntries::writeEntry(), ZoneMesh< ZoneType, MeshType >::writeEntry(), ZoneMesh< ZoneType, MeshType >::writeEntry(), and streamLineBase::writeToFile().

|
inlinenoexcept |
The number of entries in the list.
Definition at line 106 of file UPtrListI.H.
References Foam::noexcept, and ptrs_.
Referenced by singleProcessorFaceSets::add(), fvMeshAdder::add(), polyMeshAdder::add(), polyMeshAdder::add(), surfaceZonesInfo::addCellZone(), surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZone(), surfaceZonesInfo::addFaceZonesToMesh(), topOZones::addIOcellsZone(), meshRefinement::addPatch(), meshRefinement::addPointZone(), GAMGAgglomeration::agglomerateLduAddressing(), extendedEdgeMesh::allNearestFeatureEdges(), meshRefinement::appendPatch(), Foam::FieldOps::assign(), Foam::FieldOps::assign(), at(), at(), attachPolyTopoChanger::attach(), back(), back(), meshRefinement::blockLeakFaces(), snappySnapDriver::calcNearestSurface(), viewFactor::calculate(), polyBoundaryMesh::checkDefinition(), faBoundaryMesh::checkParallelSync(), polyBoundaryMesh::checkParallelSync(), PtrList< faPatch >::clone(), inverseFaceDistanceDiffusivity::correct(), nearWallDist::correct(), injectionModelList::correct(), cellDistFuncs::correctBoundaryCells(), epsilonWallFunctionFvPatchScalarField::createAveragingWeights(), omegaWallFunctionFvPatchScalarField::createAveragingWeights(), Foam::createReconstructMap(), Foam::createZeroBoundaryPtr(), motionSmootherAlgo::curPoints(), volumetricBSplinesMotionSolver::curPoints(), cyclicACMIGAMGInterface::cyclicACMIGAMGInterface(), cyclicAMIGAMGInterface::cyclicAMIGAMGInterface(), fvMeshDistribute::distribute(), snappyLayerDriver::doLayers(), PtrDynList< T, SizeMin >::emplace_set(), Foam::extract(), extrudePatchMesh::extrudePatchMesh(), faBoundaryMesh::faBoundaryMesh(), faBoundaryMesh::faBoundaryMesh(), patchFieldProbe::findElements(), volPointInterpolationAdjoint::flatBoundaryField(), GAMGSolver::GAMGSolver(), surfaceZonesInfo::getAllClosedNamedSurfaces(), surfaceZonesInfo::getClosedNamedSurfaces(), surfaceZonesInfo::getInsidePointNamedSurfaces(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getStandaloneNamedSurfaces(), surfaceZonesInfo::getUnclosedNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), meshRefinement::getZones(), GAMGProcAgglomeration::globalCellCells(), basicThermo::heBoundaryBaseTypes(), hexRef8Data::hexRef8Data(), faBoundaryMesh::indices(), faBoundaryMesh::indices(), faBoundaryMesh::indices(), pointBoundaryMesh::indices(), pointBoundaryMesh::indices(), polyBoundaryMesh::indices(), polyBoundaryMesh::indices(), interRegionExplicitPorositySource::initialise(), viewFactor::initialise(), lduMatrix::initMatrixInterfaces(), singleCellFvMesh::interpolate(), rigidBodyModel::join(), lduPrimitiveMesh::lduPrimitiveMesh(), Foam::MULES::limitSum(), Foam::MULES::limitSum(), meshRefinement::makeDisplacementField(), polyTopoChange::makeMesh(), mapDistributeBase::mapDistributeBase(), meshToMesh::mapSrcToTgt(), meshToMesh::mapTgtToSrc(), blockMesh::mesh(), extendedEdgeMesh::nearestFeatureEdgeByType(), polyBoundaryMesh::neighbourEdges(), fvMeshTools::newMesh(), Foam::operator<<(), Foam::operator<<(), faBoundaryMesh::operator=(), polyBoundaryMesh::operator=(), PtrDynList< T, SizeMin >::operator=(), PtrDynList< T, SizeMin >::operator=(), PtrDynList< T, SizeMin >::operator=(), blockMesh::patchDicts(), polyBoundaryMesh::patchID(), lumpedPointDisplacementPointPatchVectorField::patchIds(), boundaryMesh::patchify(), pointBoundaryMesh::pointBoundaryMesh(), polyBoundaryMesh::polyBoundaryMesh(), polyBoundaryMesh::polyBoundaryMesh(), PtrDynList< T, SizeMin >::pop_back(), powerLawLopesdaCostaZone::powerLawLopesdaCostaZone(), foamToVtkReportFields::print(), GAMGAgglomeration::printLevels(), GAMGAgglomeration::procAgglomerateLduAddressing(), PtrDynList< T, SizeMin >::PtrDynList(), PtrDynList< T, SizeMin >::PtrDynList(), PtrDynList< T, SizeMin >::PtrDynList(), PtrDynList< T, SizeMin >::PtrDynList(), PtrList< T >::PtrList(), PtrDynList< T, SizeMin >::push_back(), PtrDynList< T, SizeMin >::push_back(), PtrDynList< T, SizeMin >::push_back(), PtrDynList< Foam::Field< label > >::push_back(), PtrList< T >::push_back(), multiphaseInterHtcModel::q(), reactingEulerHtcModel::q(), sampledSurfaces::read(), Foam::readFields(), Foam::readUniformFields(), polyMesh::readUpdate(), refinementHistory::refinementHistory(), PtrList< T >::release(), faBoundaryMeshEntries::removeProcPatches(), polyBoundaryMeshEntries::removeProcPatches(), reorder(), PtrDynList< T, SizeMin >::reserve(), PtrDynList< T, SizeMin >::reserve_exact(), fvMeshSubset::reset(), fvMeshSubset::reset(), PtrList< T >::resize(), sampledPatchInternalField::sampleOnPoints(), PtrDynList< T, SizeMin >::set(), ZoneMesh< ZoneType, MeshType >::setGroup(), coordSetWriter::setTracks(), Foam::shuffle(), singleCellFvMesh::singleCellFvMesh(), Foam::sortedOrder(), sortOrder(), squeezeNull(), Foam::fvc::surfaceSum(), Foam::FieldOps::ternary(), Foam::FieldOps::ternarySelect(), blockMesh::topology(), PtrDynList< T, SizeMin >::transfer(), streamLineBase::trimToBox(), PtrDynList< T, SizeMin >::try_emplace(), GeometricBoundaryField< Type, PatchField, GeoMesh >::types(), cellVolumeWeight::update(), inverseDistance::update(), trackingInverseDistance::update(), sampledFaceZone::update(), oversetFvMeshBase::updateAddressing(), designVariablesUpdate::updateGradientsAndValues(), lduMatrix::updateMatrixInterfaces(), UPtrList(), Foam::vertices(), faBoundaryMesh::whichPatch(), faBoundaryMeshEntries::writeEntries(), polyBoundaryMeshEntries::writeEntries(), faBoundaryMesh::writeEntry(), polyBoundaryMesh::writeEntry(), ZoneMesh< ZoneType, MeshType >::writeEntry(), ZoneMesh< ZoneType, MeshType >::ZoneMesh(), and ZoneMesh< faFaceZone, faMesh >::ZoneMesh().
|
inlinenoexcept |
Size of the underlying storage.
Definition at line 113 of file UPtrListI.H.
References Foam::noexcept, and ptrs_.
|
inlinenoexcept |
The number of non-nullptr entries in the list.
Definition at line 120 of file UPtrListI.H.
References Foam::noexcept.
Referenced by UPtrList< const lduInterface >::count().

Reference to the first element of the list.
Definition at line 223 of file UPtrListI.H.
References at(), and Foam::T().
Referenced by UPtrList< const lduInterface >::first(), and UPtrList< const lduInterface >::first().


Reference to first element of the list.
Definition at line 230 of file UPtrListI.H.
References at(), and Foam::T().

Reference to the last element of the list.
Definition at line 237 of file UPtrListI.H.
References at(), size(), and Foam::T().
Referenced by UPtrList< const lduInterface >::last(), and UPtrList< const lduInterface >::last().


Reference to the last element of the list.
Definition at line 244 of file UPtrListI.H.
References at(), size(), and Foam::T().

Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
The return value can be tested as a bool.
Definition at line 127 of file UPtrListI.H.
References ptrs_, and Foam::T().
Referenced by coordinateSystems::cfind(), and procLduMatrix::procLduMatrix().


Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
The return value can be tested as a bool.
Definition at line 134 of file UPtrListI.H.
References ptrs_, and Foam::T().
Referenced by fvMeshAdder::add(), UPtrList< const lduInterface >::FOAM_DEPRECATED_FOR(), RecycleInteraction< CloudType >::postEvolve(), PtrList< CloudFunctionObject< CloudType > >::push_back(), UPtrList< const lduInterface >::set(), coordSetWriter::setTracks(), lduPrimitiveMeshAssembly::update(), and lduMatrix::updateMatrixInterfaces().


Return pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
The return value can be tested as a bool.
Definition at line 141 of file UPtrListI.H.
References ptrs_, and Foam::T().

Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking).
The return value can be tested as a bool.
Definition at line 366 of file UPtrList.H.
Referenced by fvMeshAdder::add(), GAMGAgglomeration::agglomerateLduAddressing(), GAMGAgglomeration::combineLevels(), directionalMeshWave::correct(), meshWave::correct(), wallDistData< TransferType >::correct(), fvMatrix< Type >::createOrUpdateLduPrimitiveAssembly(), HashTable< T, Key, Hash >::csorted(), cyclicACMIGAMGInterface::cyclicACMIGAMGInterface(), cyclicAMIGAMGInterface::cyclicAMIGAMGInterface(), fvMeshDistribute::distribute(), faBoundaryMesh::edgeFaces(), faBoundaryMesh::edgeLabels(), PtrList< T >::emplace_set(), fvBoundaryMesh::faceCells(), polyBoundaryMesh::faceCells(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), GAMGProcAgglomeration::globalCellCells(), hexRef8Data::hexRef8Data(), viewFactor::initialise(), lduMatrix::initMatrixInterfaces(), faBoundaryMesh::interfaces(), fvBoundaryMesh::interfaces(), GeometricBoundaryField< Type, PatchField, GeoMesh >::interfaces(), lduPrimitiveMesh::lduPrimitiveMesh(), Foam::MULES::limitSum(), Foam::MULES::limitSum(), fvMeshAdder::MapDimFields(), mapDistributeBase::mapDistributeBase(), fvMeshAdder::MapSurfaceFields(), fvMeshAdder::MapVolFields(), faceAreaPairGAMGAgglomeration::movePoints(), IOobjectList::objectsTypeImpl(), objectRegistry::objectsTypeImpl(), Foam::operator<<(), GAMGAgglomeration::printLevels(), PtrList< T >::release(), coordSetWriter::repackageFields(), coordSetWriter::repackageFields(), GeometricBoundaryField< Type, PatchField, GeoMesh >::scalarInterfaces(), PtrDynList< T, SizeMin >::set(), PtrList< T >::set(), PtrList< faPatch >::set(), fvMatrix< Type >::setInterfaces(), HashTable< T, Key, Hash >::sorted(), lduMatrix::sumA(), lduPrimitiveMeshAssembly::update(), oversetFvMeshBase::updateAddressing(), lduMatrix::updateMatrixInterfaces(), and oversetFvMeshBase::write().
|
inline |
Set list size to zero.
Definition at line 195 of file UPtrListI.H.
References ptrs_.
Referenced by PtrList< T >::clear().

|
inline |
Nullify all entries. Does not change the list size.
Definition at line 202 of file UPtrListI.H.
References ptrs_.
|
inline |
Change the size of the list. Any new entries are nullptr.
Definition at line 251 of file UPtrListI.H.
References ptrs_.
Referenced by IOobjectList::objectsTypeImpl(), objectRegistry::objectsTypeImpl(), and UPtrList< const lduInterface >::setSize().

|
inline |
Set the list to the given size and set all entries to nullptr.
Definition at line 258 of file UPtrListI.H.
References ptrs_.
Referenced by PtrList< T >::resize_null().

| Foam::label squeezeNull | ( | ) |
Squeeze out nullptr entries in the list of pointers after which any null pointers will be at the end of the list.
Definition at line 38 of file UPtrList.C.
References ptrs_, size(), and Foam::T().
Referenced by PtrDynList< T, SizeMin >::squeezeNull().


Append an element to the end of the list.
Definition at line 265 of file UPtrListI.H.
References ptrs_, and Foam::T().
Referenced by UPtrList< const lduInterface >::append(), UPtrList< const lduInterface >::append(), PtrList< T >::emplace_back(), PtrList< T >::push_back(), PtrList< T >::push_back(), PtrList< T >::push_back(), PtrList< T >::push_back(), and PtrList< T >::push_back().


Move append another list to the end of this list.
Definition at line 272 of file UPtrListI.H.
References ptrs_, and UPtrList().

Swap content.
Definition at line 209 of file UPtrListI.H.
References ptrs_, and UPtrList().

Transfer contents into this list and annul the argument.
Definition at line 216 of file UPtrListI.H.
References ptrs_, and UPtrList().

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 182 of file UPtrListI.H.
References ptrs_, and Foam::T().

| void reorder | ( | const labelUList & | oldToNew, |
| const bool | check = false ) |
Reorder elements. Reordering must be unique (ie, shuffle).
Optionally check that all pointers have been set.
Definition at line 62 of file UPtrList.C.
References Foam::abort(), Foam::check(), PtrListDetail< T >::checkNonNull(), Foam::FatalError, FatalErrorInFunction, name, Foam::nl, ptrs_, UList< T >::size(), size(), and Foam::T().
Referenced by meshRefinement::addPatch(), LBFGS::pivotFields(), pointBoundaryMesh::reorder(), polyBoundaryMesh::reorder(), fvMeshTools::reorderPatches(), and fvMeshSubset::reset().


| void sortOrder | ( | const labelUList & | order, |
| const bool | check = false ) |
Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle).
Optionally check that all pointers have been set.
Definition at line 112 of file UPtrList.C.
References Foam::abort(), Foam::check(), PtrListDetail< T >::checkNonNull(), Foam::FatalError, FatalErrorInFunction, name, Foam::nl, ptrs_, UList< T >::size(), size(), and Foam::T().
Referenced by Foam::shuffle().


|
inline |
Check and raise FatalError if any nullptr exists in the list.
Definition at line 280 of file UPtrListI.H.
References ptrs_.
Return const reference to the element at given position. FatalError for bounds problem or nullptr.
Definition at line 148 of file UPtrListI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, ptrs_, size(), and Foam::T().
Referenced by back(), back(), front(), front(), operator[](), and operator[]().


Return reference to the element at given position. FatalError for bounds problem or nullptr.
Definition at line 165 of file UPtrListI.H.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, ptrs_, size(), and Foam::T().

Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at().
Definition at line 289 of file UPtrListI.H.
References at(), and Foam::T().
Referenced by faBoundaryMesh::calcGeometry(), faBoundaryMesh::movePoints(), pointBoundaryMesh::movePoints(), faBoundaryMesh::updateMesh(), pointBoundaryMesh::updateMesh(), and faBoundaryMesh::whichPatch().


Return reference to the element at given position. FatalError for bounds problem or nullptr. Same as at().
Definition at line 296 of file UPtrListI.H.
References at(), and Foam::T().

Deprecated(2022-09) - same as get().
Definition at line 485 of file UPtrList.H.
Copy assignment (shallow copies addresses).
Definition at line 465 of file UPtrListI.H.
References ptrs_, and UPtrList().

Move assignment.
Definition at line 472 of file UPtrListI.H.
References ptrs_, and UPtrList().

| Foam::Ostream & printAddresses | ( | Ostream & | os | ) | const |
Print pointer addresses to Ostream (debugging only).
Definition at line 167 of file UPtrList.C.
Referenced by PtrDynList< T, SizeMin >::printAddresses().


| Foam::Ostream & writeList | ( | Ostream & | os, |
| const bool | trimNull = false ) const |
Iterator to begin of raw pointers traversal (use with caution).
Definition at line 798 of file UPtrList.H.
Referenced by Foam::sort(), and Foam::sort().

Iterator beyond end of raw pointers traversal (use with caution).
Definition at line 803 of file UPtrList.H.
Referenced by Foam::sort(), and Foam::sort().

|
inline |
Return iterator to begin traversal of non-nullptr entries.
Definition at line 416 of file UPtrListI.H.
Referenced by ZoneMesh< ZoneType, MeshType >::cfindZone().

|
inlinenoexcept |
Return iterator beyond end of UPtrList traversal.
Definition at line 440 of file UPtrListI.H.
References Foam::noexcept.
Referenced by ZoneMesh< ZoneType, MeshType >::cfindZone().

|
inline |
Return const_iterator to begin traversal of non-nullptr entries.
Definition at line 432 of file UPtrListI.H.
|
inlinenoexcept |
Return const_iterator beyond end of UPtrList traversal.
Definition at line 456 of file UPtrListI.H.
References Foam::noexcept.
|
inline |
Return const_iterator to begin traversal of non-nullptr entries.
Definition at line 424 of file UPtrListI.H.
|
inlinenoexcept |
Return const_iterator beyond end of UPtrList traversal.
Definition at line 448 of file UPtrListI.H.
References Foam::noexcept.
|
inline |
Alias for resize().
Definition at line 842 of file UPtrList.H.
Referenced by fvMatrix< Type >::setInterfaces(), lduPrimitiveMeshAssembly::update(), and oversetFvMeshBase::updateAddressing().

Reference to the first element of the list.
FOAM_DEPRECATED_FOR(2022-10, "front()")
Definition at line 849 of file UPtrList.H.
Referenced by PtrDynList< T, SizeMin >::PtrDynList().

Return reference to first element of the list.
FOAM_DEPRECATED_FOR(2022-10, "front()")
Definition at line 856 of file UPtrList.H.
Return reference to the last element of the list.
FOAM_DEPRECATED_FOR(2022-10, "back()")
Definition at line 863 of file UPtrList.H.
Referenced by fvMatrix< Type >::setInterfaces().

Return reference to the last element of the list.
FOAM_DEPRECATED_FOR(2022-10, "back()")
Definition at line 870 of file UPtrList.H.
Append an element to the end of the list.
FOAM_DEPRECATED_FOR(2022-10, "push_back()")
Definition at line 877 of file UPtrList.H.
Move append another list to the end of this list.
FOAM_DEPRECATED_FOR(2022-10, "push_back()")
Definition at line 884 of file UPtrList.H.
|
inlinenoexcept |
The number of non-nullptr entries in the list.
Definition at line 890 of file UPtrList.H.
Referenced by faBoundaryMesh::nNonProcessor(), pointBoundaryMesh::nNonProcessor(), polyBoundaryMesh::nNonProcessor(), faBoundaryMesh::nNonProcessorEdges(), polyBoundaryMesh::nNonProcessorFaces(), faBoundaryMesh::nProcessorPatches(), pointBoundaryMesh::nProcessorPatches(), polyBoundaryMesh::nProcessorPatches(), and blockMesh::numZonedBlocks().

Allow iterator access to internals.
Definition at line 517 of file UPtrList.H.
Allow iterator access to internals.
Definition at line 517 of file UPtrList.H.
|
protected |
The list of pointers.
Definition at line 109 of file UPtrList.H.
Referenced by at(), at(), capacity(), checkNonNull(), PtrList< T >::clear(), clear(), PtrList< faPatch >::clone(), empty(), find_next(), PtrList< T >::free(), free(), get(), get(), operator=(), operator=(), PtrDynList< T, SizeMin >::printAddresses(), printAddresses(), PtrList< T >::PtrList(), PtrDynList< T, SizeMin >::push_back(), push_back(), push_back(), reorder(), PtrList< T >::resize(), resize(), PtrList< T >::resize_null(), resize_null(), set(), setAddressableSize(), size(), sortOrder(), squeezeNull(), swap(), test(), PtrList< T >::transfer(), transfer(), UPtrList(), UPtrList(), UPtrList(), UPtrList(), UPtrList(), UPtrList(), UPtrList(), UPtrList(), writeList(), and PtrList< T >::~PtrList().