UPtrList< T > Class Template Reference

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...

Inherited by PtrList< T >, PtrList< block >, PtrList< blockEdge >, PtrList< blockFace >, PtrList< blockVertex >, PtrList< bodyMesh >, PtrList< boundaryEntry >, PtrList< cellZone >, PtrList< CloudFunctionObject< CloudType > >, PtrList< CloudFunctionObject< KinematicCloud< Cloud< basicKinematicCollidingParcel > > > >, PtrList< CloudFunctionObject< KinematicCloud< CloudType > > >, PtrList< CloudFunctionObject< KinematicCloud< Foam::DSMCCloud > > >, PtrList< coalCloud >, PtrList< const Foam::lduInterface >, PtrList< const Foam::lduPrimitiveProcessorInterface >, PtrList< coordinateSystem >, PtrList< entry >, PtrList< extendedFeatureEdgeMesh >, PtrList< fa::option >, PtrList< faceZone >, PtrList< faPatchMapper >, PtrList< Field< Type > >, PtrList< Foam::adjointSensitivity >, PtrList< Foam::adjointSolver >, PtrList< Foam::adjointSolverManager >, PtrList< Foam::AMIInterpolation >, PtrList< Foam::boundaryPatch >, PtrList< Foam::cellModel >, PtrList< Foam::cellSizeAndAlignmentControl >, PtrList< Foam::cellSizeFunction >, PtrList< Foam::coordSet >, PtrList< Foam::coordSetWriter >, PtrList< Foam::coordSystem::cartesian >, PtrList< Foam::decompositionConstraint >, PtrList< Foam::decompositionMethod >, PtrList< Foam::diameterModels::binaryBreakupModel >, PtrList< Foam::diameterModels::breakupModel >, PtrList< Foam::diameterModels::coalescenceModel >, PtrList< Foam::diameterModels::driftModel >, PtrList< Foam::diameterModels::IATEsource >, PtrList< Foam::diameterModels::nucleationModel >, PtrList< Foam::diameterModels::populationBalanceModel >, PtrList< Foam::dictionary >, PtrList< Foam::dimensioned >, PtrList< Foam::DimensionedField >, PtrList< Foam::DimensionedField< Foam::SphericalTensor, Foam::volMesh > >, PtrList< Foam::DimensionedField< Foam::SymmTensor, Foam::volMesh > >, PtrList< Foam::DimensionedField< Foam::tensor, Foam::volMesh > >, PtrList< Foam::DimensionedField< Foam::vector, Foam::volMesh > >, PtrList< Foam::DimensionedField< scalar, Foam::volMesh > >, PtrList< Foam::distributionModels::general >, PtrList< Foam::entry >, PtrList< Foam::extendedFeatureEdgeMesh >, PtrList< Foam::faFieldDecomposer::patchFieldDecomposer >, PtrList< Foam::faFieldDecomposer::processorAreaPatchFieldDecomposer >, PtrList< Foam::faFieldDecomposer::processorEdgePatchFieldDecomposer >, PtrList< Foam::faMesh >, PtrList< Foam::Field >, PtrList< Foam::Field< Foam::SphericalTensor > >, PtrList< Foam::Field< Foam::SymmTensor > >, PtrList< Foam::Field< Foam::tensor > >, PtrList< Foam::Field< Foam::vector > >, PtrList< Foam::Field< label > >, PtrList< Foam::Field< LUType > >, PtrList< Foam::Field< scalar > >, PtrList< Foam::Field< solveScalar > >, PtrList< Foam::FieldField< Foam::Field, scalar > >, PtrList< Foam::FieldField< Foam::Field, solveScalar > >, PtrList< Foam::Function1< Foam::SymmTensor > >, PtrList< Foam::Function1< Foam::vector > >, PtrList< Foam::Function1< scalar > >, PtrList< Foam::Function1< Type > >, PtrList< Foam::Function1< TypeR > >, PtrList< Foam::functionObject >, PtrList< Foam::functionObjects::runTimeControls::runTimeCondition >, PtrList< Foam::fvFieldDecomposer::patchFieldDecomposer >, PtrList< Foam::fvFieldDecomposer::processorSurfacePatchFieldDecomposer >, PtrList< Foam::fvFieldDecomposer::processorVolPatchFieldDecomposer >, PtrList< Foam::fvMatrix< Type > >, PtrList< Foam::fvMeshSubset >, PtrList< Foam::GeometricField< Foam::SphericalTensor, Foam::faePatchField, Foam::edgeMesh > >, PtrList< Foam::GeometricField< Foam::SphericalTensor, Foam::faPatchField, Foam::areaMesh > >, PtrList< Foam::GeometricField< Foam::SphericalTensor, Foam::fvPatchField, Foam::volMesh > >, PtrList< Foam::GeometricField< Foam::SphericalTensor, Foam::fvsPatchField, Foam::surfaceMesh > >, PtrList< Foam::GeometricField< Foam::SphericalTensor, Foam::pointPatchField, Foam::pointMesh > >, PtrList< Foam::GeometricField< Foam::SymmTensor, Foam::faePatchField, Foam::edgeMesh > >, PtrList< Foam::GeometricField< Foam::SymmTensor, Foam::faPatchField, Foam::areaMesh > >, PtrList< Foam::GeometricField< Foam::SymmTensor, Foam::fvPatchField, Foam::volMesh > >, PtrList< Foam::GeometricField< Foam::SymmTensor, Foam::fvsPatchField, Foam::surfaceMesh > >, PtrList< Foam::GeometricField< Foam::SymmTensor, Foam::pointPatchField, Foam::pointMesh > >, PtrList< Foam::GeometricField< Foam::tensor, Foam::faePatchField, Foam::edgeMesh > >, PtrList< Foam::GeometricField< Foam::tensor, Foam::faPatchField, Foam::areaMesh > >, PtrList< Foam::GeometricField< Foam::tensor, Foam::fvPatchField, Foam::volMesh > >, PtrList< Foam::GeometricField< Foam::tensor, Foam::fvsPatchField, Foam::surfaceMesh > >, PtrList< Foam::GeometricField< Foam::tensor, Foam::pointPatchField, Foam::pointMesh > >, PtrList< Foam::GeometricField< Foam::vector, Foam::faePatchField, Foam::edgeMesh > >, PtrList< Foam::GeometricField< Foam::vector, Foam::faPatchField, Foam::areaMesh > >, PtrList< Foam::GeometricField< Foam::vector, Foam::fvPatchField, Foam::volMesh > >, PtrList< Foam::GeometricField< Foam::vector, Foam::fvsPatchField, Foam::surfaceMesh > >, PtrList< Foam::GeometricField< Foam::vector, Foam::pointPatchField, Foam::pointMesh > >, PtrList< Foam::GeometricField< scalar, Foam::faePatchField, Foam::edgeMesh > >, PtrList< Foam::GeometricField< scalar, Foam::faPatchField, Foam::areaMesh > >, PtrList< Foam::GeometricField< scalar, Foam::fvPatchField, Foam::volMesh > >, PtrList< Foam::GeometricField< scalar, Foam::fvsPatchField, Foam::surfaceMesh > >, PtrList< Foam::GeometricField< scalar, Foam::pointPatchField, Foam::pointMesh > >, PtrList< Foam::ignitionSite >, PtrList< Foam::implicitFunction >, PtrList< Foam::indexedOctree >, PtrList< Foam::indexedOctree< Foam::treeDataEdge > >, PtrList< Foam::indexedOctree< Foam::treeDataPoint > >, PtrList< Foam::interpolation< Foam::vector > >, PtrList< Foam::interpolation< scalar > >, PtrList< Foam::IOList >, PtrList< Foam::lduMatrix >, PtrList< Foam::lduPrimitiveMesh >, PtrList< Foam::liquidProperties >, PtrList< Foam::List >, PtrList< Foam::List< char > >, PtrList< Foam::List< scalar > >, PtrList< Foam::List< solveScalar > >, PtrList< Foam::List< Type > >, PtrList< Foam::mapDistributeBase >, PtrList< Foam::mappedPatchBase >, PtrList< Foam::motionSolver >, PtrList< Foam::NURBS3DVolume >, PtrList< Foam::OFstream >, PtrList< Foam::PatchFunction1Types::MappedFile< scalar > >, PtrList< Foam::patchInjectionBase >, PtrList< Foam::PatchInteractionModel< Foam::DSMCCloud > >, PtrList< Foam::pointFieldDecomposer::patchFieldDecomposer >, PtrList< Foam::pointMesh >, PtrList< Foam::primalSolver >, PtrList< Foam::PrimitivePatch >, PtrList< Foam::PrimitivePatchInterpolation >, PtrList< Foam::procLduInterface >, PtrList< Foam::profilingInformation >, PtrList< Foam::PtrList< Foam::AMIInterpolation > >, PtrList< Foam::PtrList< Foam::CompactIOField< Foam::Field< Foam::SphericalTensor >, Foam::SphericalTensor > > >, PtrList< Foam::PtrList< Foam::CompactIOField< Foam::Field< Foam::SymmTensor >, Foam::SymmTensor > > >, PtrList< Foam::PtrList< Foam::CompactIOField< Foam::Field< Foam::tensor >, Foam::tensor > > >, PtrList< Foam::PtrList< Foam::CompactIOField< Foam::Field< Foam::vector >, Foam::vector > > >, PtrList< Foam::PtrList< Foam::CompactIOField< Foam::Field< label >, label > > >, PtrList< Foam::PtrList< Foam::CompactIOField< Foam::Field< scalar >, scalar > > >, PtrList< Foam::PtrList< Foam::dimensioned > >, PtrList< Foam::PtrList< Foam::IOField< Foam::SphericalTensor > > >, PtrList< Foam::PtrList< Foam::IOField< Foam::SymmTensor > > >, PtrList< Foam::PtrList< Foam::IOField< Foam::tensor > > >, PtrList< Foam::PtrList< Foam::IOField< Foam::vector > > >, PtrList< Foam::PtrList< Foam::IOField< label > > >, PtrList< Foam::PtrList< Foam::IOField< scalar > > >, PtrList< Foam::PtrList< Foam::lduInterfaceField > >, PtrList< Foam::radiation::boundaryRadiationPropertiesPatch >, PtrList< Foam::radiation::radiativeIntensityRay >, PtrList< Foam::RBD::joint >, PtrList< Foam::RBD::restraint >, PtrList< Foam::RBD::rigidBody >, PtrList< Foam::RBD::subBody >, PtrList< Foam::Reaction< SolidThermo > >, PtrList< Foam::Reaction< ThermoType > >, PtrList< Foam::sixDoFRigidBodyMotionConstraint >, PtrList< Foam::sixDoFRigidBodyMotionRestraint >, PtrList< Foam::solidBodyMotionFunction >, PtrList< Foam::solidProperties >, PtrList< Foam::surfaceWriter >, PtrList< Foam::surfaceZonesInfo >, PtrList< Foam::Time >, PtrList< Foam::topoSetFaceSource >, PtrList< Foam::triSurfaceMesh >, PtrList< Foam::UPstream::communicator >, PtrList< Foam::UPtrList >, PtrList< Foam::vtk::vtuCells >, PtrList< force >, PtrList< functionObject >, PtrList< fv::option >, PtrList< fvPatchMapper >, PtrList< GasThermo >, PtrList< injectionModel >, PtrList< InjectionModel< CloudType > >, PtrList< InjectionModel< Foam::KinematicCloud< Cloud< basicKinematicCollidingParcel > > > >, PtrList< InjectionModel< Foam::KinematicCloud< CloudType > > >, PtrList< InjectionModel< Foam::KinematicCloud< Foam::DSMCCloud > > >, PtrList< joint >, PtrList< MRFZone >, PtrList< pairPotential >, PtrList< ParticleForce< CloudType > >, PtrList< ParticleForce< KinematicCloud< Cloud< basicKinematicCollidingParcel > > > >, PtrList< ParticleForce< KinematicCloud< CloudType > > >, PtrList< ParticleForce< KinematicCloud< Foam::DSMCCloud > > >, PtrList< PatchField< Type > >, PtrList< pointPatchMapper >, PtrList< pointZone >, PtrList< polyMeshModifier >, PtrList< porosityModel >, PtrList< profileModel >, PtrList< pyrolysisModel >, PtrList< Reaction< ThermoType > >, PtrList< regionModelFunctionObject >, PtrList< sampledSet >, PtrList< sampledSurface >, PtrList< searchableSurface >, PtrList< SolidThermo >, PtrList< temperatureCoupling >, PtrList< tetherPotential >, PtrList< ThermoType >, PtrList< transferModel >, and PtrList< ZoneType >.

Classes

class  const_iterator
 Forward iterator with const access. 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...
 
struct  less
 A UPtrList compare binary predicate for normal sort order. Null entries (if any) sort to the end. More...
 
struct  value_compare
 A wrapper for a binary comparison of values that interjects pointer dereferencing with null pointer guards. More...
 

Public Types

typedef T value_type
 Type of values the list contains. More...
 
typedef Treference
 A non-const reference to the value_type. More...
 
typedef const Tconst_reference
 A const reference to the value_type. More...
 

Public Member Functions

constexpr UPtrList () noexcept=default
 Default construct. More...
 
 UPtrList (const label len)
 Construct with specified size and set all entries to nullptr. More...
 
 UPtrList (const UPtrList< T > &list)
 Copy construct (shallow copies addresses) More...
 
 UPtrList (UPtrList< T > &&list) noexcept
 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 (shallow copy) More...
 
 UPtrList (UList< T > &list)
 Construct from UList, taking the address of each list element. More...
 
bool empty () const noexcept
 True if the list is empty (ie, size() is zero) More...
 
label size () const noexcept
 The number of entries in the list. More...
 
label capacity () const noexcept
 Size of the underlying storage. More...
 
label count () const noexcept
 The number of non-null entries in the list. More...
 
Tfront ()
 Reference to the first element of the list. More...
 
const Tfront () const
 Reference to first element of the list. More...
 
Tback ()
 Reference to the last element of the list. More...
 
const Tback () const
 Reference to the last element of the list. More...
 
const Ttest (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). More...
 
const Tget (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). More...
 
Tget (const label i)
 Return pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). More...
 
const Tset (const label i) const
 Return const pointer to element (can be nullptr), or nullptr for out-of-range access (ie, with bounds checking). More...
 
void clear ()
 Set list size to zero. More...
 
void free ()
 Nullify all entries. Does not change the list size. More...
 
void resize (const label newLen)
 Change the size of the list. Any new entries are nullptr. More...
 
void resize_null (const label newLen)
 Set the list to the given size and set all entries to nullptr. More...
 
label squeezeNull ()
 Squeeze out nullptr entries in the list of pointers after which any null pointers will be at the end of the list. More...
 
void trimTrailingNull ()
 Reduce addressable list size to ignore any trailing null pointers. More...
 
void push_back (T *ptr)
 Append an element to the end of the list. More...
 
void push_back (UPtrList< T > &&other)
 Move append another list to the end of this list. More...
 
void swap (UPtrList< T > &list) noexcept
 Swap content. More...
 
void transfer (UPtrList< T > &list)
 Transfer contents into this list and annul the argument. More...
 
Tset (const label i, T *ptr)
 Set element to specified pointer and return the old list element, which can be a nullptr. More...
 
void reorder (const labelUList &oldToNew, const bool check=false)
 Reorder elements. Reordering must be unique (ie, shuffle). More...
 
void sortOrder (const labelUList &order, const bool check=false)
 Reorder elements according to new order mapping (newToOld). Reordering must be unique (ie, shuffle). More...
 
void checkNonNull () const
 Check and raise FatalError if any nullptr exists in the list. More...
 
const Tat (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr. More...
 
Tat (const label i)
 Return reference to the element at given position. FatalError for bounds problem or nullptr. More...
 
const Toperator[] (const label i) const
 Return const reference to the element at given position. FatalError for bounds problem or nullptr. Same as at(). More...
 
Toperator[] (const label i)
 Return reference to the element at given position. FatalError for bounds problem or nullptr. Same as at(). More...
 
 FOAM_DEPRECATED_FOR (2022-09, "get(), set() or test() methods") const T *operator()(const label i) const
 Deprecated(2022-09) - same as get() More...
 
void operator= (const UPtrList< T > &list)
 Copy assignment (shallow copies addresses) More...
 
void operator= (UPtrList< T > &&list)
 Move assignment. More...
 
T ** begin_ptr () noexcept
 Iterator to begin of raw pointers traversal (use with caution) More...
 
T ** end_ptr () noexcept
 Iterator beyond end of raw pointers traversal (use with caution) More...
 
iterator begin ()
 Return iterator to begin traversal of non-nullptr entries. More...
 
iterator end () noexcept
 Return iterator beyond end of UPtrList traversal. More...
 
const_iterator cbegin () const
 Return const_iterator to begin traversal of non-nullptr entries. More...
 
const_iterator cend () const noexcept
 Return const_iterator beyond end of UPtrList traversal. More...
 
const_iterator begin () const
 Return const_iterator to begin traversal of non-nullptr entries. More...
 
const_iterator end () const noexcept
 Return const_iterator beyond end of UPtrList traversal. More...
 
void setSize (const label n)
 Alias for resize() More...
 
Tfirst ()
 Reference to the first element of the list. More...
 
const Tfirst () const
 Return reference to first element of the list. More...
 
Tlast ()
 Return reference to the last element of the list. More...
 
const Tlast () const
 Return reference to the last element of the list. More...
 
void append (T *ptr)
 Append an element to the end of the list. More...
 
void append (UPtrList< T > &&other)
 Move append another list to the end of this list. More...
 

Protected Member Functions

void setAddressableSize (const label n) noexcept
 Adjust addressable size. More...
 
label find_next (label pos) const
 The next non-null entry after the specified position. More...
 
 UPtrList (Detail::PtrListDetail< T > &&ptrs) noexcept
 Low-level move construct. More...
 

Protected Attributes

Detail::PtrListDetail< Tptrs_
 The list of pointers. More...
 

Friends

class Iterator< true >
 Allow iterator access to internals. More...
 
class Iterator< false >
 Allow iterator access to internals. More...
 
Ostreamoperator (Ostream &os, const UPtrList< T > &list)
 Write UPtrList to Ostream. More...
 

Detailed Description

template<class T>
class Foam::UPtrList< T >

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:

forAll(interfaces, i)
{
if (interfaces.test(i))
{
// Interface is set, do something
const auto& intf = interfaces[i];
...
}
}

The lists can also be traversed with a for-range (in OpenFOAM-v2212 and earlier this would have failed on nullptr entries):

for (const auto& intf : interfaces)
{
// Do something
...
}

It is also possible to traverse with non-null entries and use key/val access (like HashTable naming):

forAllConstIters(interfaces, iter)
{
Info<< "entry " << iter.key() << " : " << iter.val() << nl;
}
Note
The class definition is such that it contains a list of pointers, but itself does not inherit from a list of pointers since this would wreak havoc later with inheritance resolution.
See also
Foam::PtrList Foam::PtrDynList
Source files

Definition at line 106 of file HashTable.H.

Member Typedef Documentation

◆ value_type

typedef T value_type

Type of values the list contains.

Definition at line 140 of file UPtrList.H.

◆ reference

typedef T& reference

A non-const reference to the value_type.

Definition at line 145 of file UPtrList.H.

◆ const_reference

typedef const T& const_reference

A const reference to the value_type.

Definition at line 150 of file UPtrList.H.

Constructor & Destructor Documentation

◆ UPtrList() [1/9]

UPtrList ( Detail::PtrListDetail< T > &&  ptrs)
inlineexplicitprotectednoexcept

Low-level move construct.

Definition at line 48 of file UPtrListI.H.

◆ UPtrList() [2/9]

constexpr UPtrList ( )
defaultnoexcept

Default construct.

◆ UPtrList() [3/9]

UPtrList ( const label  len)
inlineexplicit

Construct with specified size and set all entries to nullptr.

Definition at line 41 of file UPtrListI.H.

◆ UPtrList() [4/9]

UPtrList ( const UPtrList< T > &  list)
inline

Copy construct (shallow copies addresses)

Definition at line 55 of file UPtrListI.H.

◆ UPtrList() [5/9]

UPtrList ( UPtrList< T > &&  list)
inlinenoexcept

Move construct.

Definition at line 62 of file UPtrListI.H.

◆ UPtrList() [6/9]

UPtrList ( UPtrList< T > &  list,
bool  reuse 
)
inline

Construct as shallow copy or re-use as specified.

Definition at line 69 of file UPtrListI.H.

◆ UPtrList() [7/9]

UPtrList ( PtrList< T > &  list)
explicit

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.

◆ UPtrList() [8/9]

UPtrList ( const UList< T *> &  list)
inlineexplicit

Construct from UList of pointers (shallow copy)

Definition at line 76 of file UPtrListI.H.

◆ UPtrList() [9/9]

UPtrList ( UList< T > &  list)
inlineexplicit

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 83 of file UPtrListI.H.

Member Function Documentation

◆ setAddressableSize()

void setAddressableSize ( const label  n)
inlineprotectednoexcept

Adjust addressable size.

Definition at line 25 of file UPtrListI.H.

◆ find_next()

Foam::label find_next ( label  pos) const
inlineprotected

The next non-null entry after the specified position.

Definition at line 32 of file UPtrListI.H.

Referenced by UPtrList< T >::Iterator< true >::increment(), and UPtrList< T >::Iterator< true >::Iterator().

Here is the caller graph for this function:

◆ empty()

◆ size()

Foam::label size ( ) const
inlinenoexcept

The number of entries in the list.

Definition at line 106 of file UPtrListI.H.

Referenced by MRFZoneList::active(), porosityModelList::active(), oversetFvMeshBase::active(), fvMeshAdder::add(), singleProcessorFaceSets::add(), polyMeshAdder::add(), surfaceZonesInfo::addCellZone(), surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZone(), surfaceZonesInfo::addFaceZonesToMesh(), oversetFvMeshBase::addInterpolation(), topOZones::addIOcellsZone(), snappyLayerDriver::addLayers(), meshRefinement::addPatch(), meshRefinement::addPointZone(), GAMGAgglomeration::agglomerateLduAddressing(), extendedEdgeMesh::allNearestFeatureEdges(), meshRefinement::appendPatch(), attachPolyTopoChanger::attach(), meshRefinement::blockLeakFaces(), nearWallFields::calcAddressing(), addPatchCellLayer::calcExtrudeInfo(), snappySnapDriver::calcNearestSurface(), phaseSystem::calcPhi(), viewFactor::calculate(), polyTopoChange::changeMesh(), polyBoundaryMesh::checkDefinition(), faBoundaryMesh::checkParallelSync(), polyBoundaryMesh::checkParallelSync(), inverseFaceDistanceDiffusivity::correct(), nearWallDist::correct(), injectionModelList::correct(), wallDistAddressing::correct(), omegaWallFunctionFvPatchScalarField::createAveragingWeights(), epsilonWallFunctionFvPatchScalarField::createAveragingWeights(), Foam::createReconstructMap(), Foam::createZeroBoundaryPointFieldPtr(), Foam::createZeroBoundaryPtr(), volumetricBSplinesMotionSolver::curPoints(), motionSmootherAlgo::curPoints(), cyclicACMIGAMGInterface::cyclicACMIGAMGInterface(), cyclicAMIGAMGInterface::cyclicAMIGAMGInterface(), structuredDecomp::decompose(), faMeshDecomposition::decomposeMesh(), adjointSpalartAllmaras::diffusionCoeffVar1(), adjointRASModel::diffusionCoeffVar1(), adjointRASModel::diffusionCoeffVar2(), fvMeshDistribute::distribute(), snappyLayerDriver::doLayers(), snappySnapDriver::doSnap(), faBoundaryMesh::edgeFaces(), faBoundaryMesh::edgeLabels(), Foam::extract(), extrudePatchMesh::extrudePatchMesh(), faBoundaryMesh::faBoundaryMesh(), fvBoundaryMesh::faceCells(), polyBoundaryMesh::faceCells(), patchProbes::findElements(), fvFieldReconstructor::fvFieldReconstructor(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), surfaceZonesInfo::getAllClosedNamedSurfaces(), surfaceZonesInfo::getClosedNamedSurfaces(), surfaceZonesInfo::getInsidePointNamedSurfaces(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getStandaloneNamedSurfaces(), surfaceZonesInfo::getUnclosedNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), meshRefinement::getZones(), GAMGProcAgglomeration::globalCellCells(), lduPrimitiveMesh::globalCellCells(), basicThermo::heBoundaryBaseTypes(), hexRef8Data::hexRef8Data(), if(), interRegionExplicitPorositySource::initialise(), viewFactor::initialise(), lduMatrix::initMatrixInterfaces(), fvBoundaryMesh::interfaces(), faBoundaryMesh::interfaces(), edgeInterpolationScheme< scalar >::interpolate(), volPointInterpolationAdjoint::interpolateSensitivitiesField(), regionModel::interRegionAMI(), rigidBodyModel::join(), lduPrimitiveMesh::lduPrimitiveMesh(), Foam::MULES::limitSum(), triSurfaceLoader::load(), LUscalarMatrix::LUscalarMatrix(), meshRefinement::makeDisplacementField(), polyTopoChange::makeMesh(), fvMeshAdder::MapDimFields(), mapDistributeBase::mapDistributeBase(), mapPolyMesh::mapPolyMesh(), meshToMesh::mapSrcToTgt(), fvMeshAdder::MapSurfaceFields(), meshToMesh::mapTgtToSrc(), fvMeshAdder::MapVolFields(), betaMax::markProcessorEdges(), MeshedSurface< Foam::face >::MeshedSurface(), extendedEdgeMesh::nearestFeatureEdgeByType(), faMeshTools::newMesh(), fvMeshTools::newMesh(), nonBlockingGaussSeidelSmoother::nonBlockingGaussSeidelSmoother(), lduPrimitiveMesh::nonBlockingSchedule(), faMeshLduAddressing::nPatches(), RASModelVariables::nut(), Foam::operator<<(), PtrList< transferModel >::operator=(), blockMesh::patchDicts(), polyMeshAdder::patchFacePairs(), polyBoundaryMesh::patchID(), lumpedPointDisplacementPointPatchVectorField::patchIds(), boundaryMesh::patchify(), faBoundaryMesh::patchRanges(), polyBoundaryMesh::patchSet(), faBoundaryMesh::patchStarts(), adjointEikonalSolver::patchTypes(), pointFieldReconstructor::pointFieldReconstructor(), polyBoundaryMesh::polyBoundaryMesh(), polyline::polyline(), polyTopoChange::polyTopoChange(), sensitivitySurfacePoints::populateExtendedIDs(), powerLawLopesdaCostaZone::powerLawLopesdaCostaZone(), foamToVtkReportFields::print(), GAMGAgglomeration::procAgglomerateLduAddressing(), polyMeshAdder::procPatchPairs(), PtrDynList< Foam::profilingInformation >::push_back(), boundaryMesh::read(), lagrangianFieldDecomposer::readFieldFields(), fieldsDistributor::readFields(), lagrangianFieldDecomposer::readFields(), Foam::readFields(), Foam::readUniformFields(), polyMesh::readUpdate(), refinementHistory::refinementHistory(), fvMeshTools::removeEmptyPatches(), faBoundaryMeshEntries::removeProcPatches(), polyBoundaryMeshEntries::removeProcPatches(), fvMeshSubset::reset(), faFieldDecomposer::reset(), Foam::rewritePatchLabels(), ReynoldsAnalogy::rho(), Foam::selectPatchFaces(), faBoundaryMesh::setGroup(), ZoneMesh< cellZone, polyMesh >::setGroup(), polyBoundaryMesh::setGroup(), removeCells::setRefinement(), meshCutAndRemove::setRefinement(), coordSetWriter::setTracks(), shortestPathSet::shortestPathSet(), Foam::shuffle(), singleCellFvMesh::singleCellFvMesh(), Foam::sortedOrder(), triSurface::sortedZones(), syncTools::syncFaceList(), RASModelVariables::TMVar1(), RASModelVariables::TMVar2(), blockMesh::topology(), streamLineBase::trimToBox(), GeometricBoundaryField< Foam::vector, Foam::fvPatchField, Foam::volMesh >::types(), liquidFilmBase::Up(), trackingInverseDistance::update(), cellVolumeWeight::update(), sampledFaceZone::update(), inverseDistance::update(), oversetFvMeshBase::updateAddressing(), designVariablesUpdate::updateGradientsAndValues(), lduPrimitiveMeshAssembly::updateMaps(), lduMatrix::updateMatrixInterfaces(), faMesh::updateMesh(), liquidFilmBase::Uw(), Foam::vertices(), wallLayerCells::wallLayerCells(), OFstreamCollator::write(), multiFieldValue::write(), faBoundaryMeshEntries::writeEntries(), polyBoundaryMeshEntries::writeEntries(), faBoundaryMesh::writeEntry(), polyBoundaryMesh::writeEntry(), externalCoupled::writeGeometry(), cellZoneSet::writeObject(), pointZoneSet::writeObject(), faceZoneSet::writeObject(), gltfWriter::writeTemplate(), gltfWriter::writeTemplate_animate(), Foam::ensightOutput::writeVolField(), and ZoneMesh< cellZone, polyMesh >::ZoneMesh().

◆ capacity()

Foam::label capacity ( ) const
inlinenoexcept

Size of the underlying storage.

Definition at line 113 of file UPtrListI.H.

◆ count()

Foam::label count ( ) const
inlinenoexcept

The number of non-null entries in the list.

Definition at line 120 of file UPtrListI.H.

◆ front() [1/2]

T & front ( )
inline

Reference to the first element of the list.

Definition at line 223 of file UPtrListI.H.

Referenced by UPtrList< const Foam::UList >::first().

Here is the caller graph for this function:

◆ front() [2/2]

const T & front ( ) const
inline

Reference to first element of the list.

Definition at line 230 of file UPtrListI.H.

◆ back() [1/2]

T & back ( )
inline

Reference to the last element of the list.

Definition at line 237 of file UPtrListI.H.

Referenced by UPtrList< const Foam::UList >::last().

Here is the caller graph for this function:

◆ back() [2/2]

const T & back ( ) const
inline

Reference to the last element of the list.

Definition at line 244 of file UPtrListI.H.

◆ test()

const T * test ( const label  i) const
inline

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.

Referenced by coordinateSystems::cfind(), boundaryRadiationProperties::faceZoneIds(), fvMeshAdder::MapDimFields(), fvMeshAdder::MapSurfaceFields(), and fvMeshAdder::MapVolFields().

Here is the caller graph for this function:

◆ get() [1/2]

const T * get ( const label  i) const
inline

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.

Referenced by fvMeshAdder::add(), ZoneMesh< cellZone, polyMesh >::cfindZone(), Cloud< passivePositionParticle >::move(), RecycleInteraction< CloudType >::postEvolve(), coordSetWriter::setTracks(), lduPrimitiveMeshAssembly::update(), and lduMatrix::updateMatrixInterfaces().

Here is the caller graph for this function:

◆ get() [2/2]

T * get ( const label  i)
inline

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.

◆ set() [1/2]

◆ clear()

void clear ( )
inline

Set list size to zero.

Definition at line 195 of file UPtrListI.H.

Referenced by gltfWriter::writeTemplate_animate().

Here is the caller graph for this function:

◆ free()

void free ( )
inline

Nullify all entries. Does not change the list size.

Definition at line 202 of file UPtrListI.H.

◆ resize()

void resize ( const label  newLen)
inline

Change the size of the list. Any new entries are nullptr.

Definition at line 251 of file UPtrListI.H.

Referenced by UPtrList< const Foam::UList >::setSize().

Here is the caller graph for this function:

◆ resize_null()

void resize_null ( const label  newLen)
inline

Set the list to the given size and set all entries to nullptr.

Definition at line 258 of file UPtrListI.H.

◆ squeezeNull()

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.

Returns
the number of non-null entries

Definition at line 38 of file UPtrList.C.

◆ trimTrailingNull()

void trimTrailingNull ( )

Reduce addressable list size to ignore any trailing null pointers.

The reduces the effective list length without reallocation

Definition at line 62 of file UPtrList.C.

◆ push_back() [1/2]

void push_back ( T ptr)
inline

Append an element to the end of the list.

Definition at line 265 of file UPtrListI.H.

Referenced by UPtrList< const Foam::UList >::append(), lagrangianFieldDecomposer::readFieldFields(), and lagrangianReconstructor::reconstructFieldFields().

Here is the caller graph for this function:

◆ push_back() [2/2]

void push_back ( UPtrList< T > &&  other)
inline

Move append another list to the end of this list.

Definition at line 272 of file UPtrListI.H.

◆ swap()

void swap ( UPtrList< T > &  list)
inlinenoexcept

Swap content.

Definition at line 209 of file UPtrListI.H.

◆ transfer()

void transfer ( UPtrList< T > &  list)
inline

Transfer contents into this list and annul the argument.

Definition at line 216 of file UPtrListI.H.

Referenced by wallDistData< TransferType >::correct(), directionalMeshWave::correct(), and meshWave::correct().

Here is the caller graph for this function:

◆ set() [2/2]

T * set ( const label  i,
T ptr 
)
inline

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.

◆ reorder()

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 79 of file UPtrList.C.

Referenced by meshRefinement::addPatch(), LBFGS::pivotFields(), polyBoundaryMesh::reorder(), and fvMeshTools::reorderPatches().

Here is the caller graph for this function:

◆ sortOrder()

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 128 of file UPtrList.C.

Referenced by Foam::shuffle().

Here is the caller graph for this function:

◆ checkNonNull()

void checkNonNull ( ) const
inline

Check and raise FatalError if any nullptr exists in the list.

Definition at line 280 of file UPtrListI.H.

◆ at() [1/2]

const T & at ( const label  i) const
inline

Return const reference to the element at given position. FatalError for bounds problem or nullptr.

Definition at line 148 of file UPtrListI.H.

◆ at() [2/2]

T & at ( const label  i)
inline

Return reference to the element at given position. FatalError for bounds problem or nullptr.

Definition at line 165 of file UPtrListI.H.

◆ operator[]() [1/2]

const T & operator[] ( const label  i) const
inline

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.

Referenced by MRFZoneList::active(), porosityModelList::active(), forceList::correct(), coalCloudList::evolve(), pyrolysisModelCollection::evolve(), pyrolysisModelCollection::evolveRegion(), pyrolysisModelCollection::info(), injectionModelList::info(), transferModelList::info(), pyrolysisModelCollection::preEvolveRegion(), and coalCloudList::UTrans().

Here is the caller graph for this function:

◆ operator[]() [2/2]

T & operator[] ( const label  i)
inline

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.

◆ FOAM_DEPRECATED_FOR()

FOAM_DEPRECATED_FOR ( 2022-  09,
get(),
set() or test() methods"   
) const
inline

Deprecated(2022-09) - same as get()

Deprecated:
(2022-09) - use get(), set() or test() methods

Definition at line 492 of file UPtrList.H.

◆ operator=() [1/2]

void operator= ( const UPtrList< T > &  list)
inline

Copy assignment (shallow copies addresses)

Definition at line 465 of file UPtrListI.H.

◆ operator=() [2/2]

void operator= ( UPtrList< T > &&  list)
inline

Move assignment.

Definition at line 472 of file UPtrListI.H.

◆ begin_ptr()

T** begin_ptr ( )
inlinenoexcept

Iterator to begin of raw pointers traversal (use with caution)

Definition at line 796 of file UPtrList.H.

Referenced by Foam::sort().

Here is the caller graph for this function:

◆ end_ptr()

T** end_ptr ( )
inlinenoexcept

Iterator beyond end of raw pointers traversal (use with caution)

Definition at line 801 of file UPtrList.H.

Referenced by Foam::sort().

Here is the caller graph for this function:

◆ begin() [1/2]

Foam::UPtrList< T >::iterator begin ( )
inline

Return iterator to begin traversal of non-nullptr entries.

Definition at line 416 of file UPtrListI.H.

Referenced by ZoneMesh< cellZone, polyMesh >::cfindZone().

Here is the caller graph for this function:

◆ end() [1/2]

Foam::UPtrList< T >::iterator end ( )
inlinenoexcept

Return iterator beyond end of UPtrList traversal.

Definition at line 440 of file UPtrListI.H.

Referenced by ZoneMesh< cellZone, polyMesh >::cfindZone().

Here is the caller graph for this function:

◆ cbegin()

Foam::UPtrList< T >::const_iterator cbegin ( ) const
inline

Return const_iterator to begin traversal of non-nullptr entries.

Definition at line 432 of file UPtrListI.H.

◆ cend()

Foam::UPtrList< T >::const_iterator cend ( ) const
inlinenoexcept

Return const_iterator beyond end of UPtrList traversal.

Definition at line 456 of file UPtrListI.H.

◆ begin() [2/2]

Foam::UPtrList< T >::const_iterator begin ( ) const
inline

Return const_iterator to begin traversal of non-nullptr entries.

Definition at line 424 of file UPtrListI.H.

◆ end() [2/2]

Foam::UPtrList< T >::const_iterator end ( ) const
inlinenoexcept

Return const_iterator beyond end of UPtrList traversal.

Definition at line 448 of file UPtrListI.H.

◆ setSize()

void setSize ( const label  n)
inline

Alias for resize()

Definition at line 840 of file UPtrList.H.

Referenced by fvMatrix< Type >::setInterfaces(), and oversetFvMeshBase::updateAddressing().

Here is the caller graph for this function:

◆ first() [1/2]

T& first ( )
inline

Reference to the first element of the list.

FOAM_DEPRECATED_FOR(2022-10, "front()")

Definition at line 847 of file UPtrList.H.

◆ first() [2/2]

const T& first ( ) const
inline

Return reference to first element of the list.

FOAM_DEPRECATED_FOR(2022-10, "front()")

Definition at line 854 of file UPtrList.H.

◆ last() [1/2]

T& last ( )
inline

Return reference to the last element of the list.

FOAM_DEPRECATED_FOR(2022-10, "back()")

Definition at line 861 of file UPtrList.H.

Referenced by polyline::polyline(), and fvMatrix< Type >::setInterfaces().

Here is the caller graph for this function:

◆ last() [2/2]

const T& last ( ) const
inline

Return reference to the last element of the list.

FOAM_DEPRECATED_FOR(2022-10, "back()")

Definition at line 868 of file UPtrList.H.

◆ append() [1/2]

void append ( T ptr)
inline

Append an element to the end of the list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 875 of file UPtrList.H.

◆ append() [2/2]

void append ( UPtrList< T > &&  other)
inline

Move append another list to the end of this list.

FOAM_DEPRECATED_FOR(2022-10, "push_back()")

Definition at line 882 of file UPtrList.H.

Friends And Related Function Documentation

◆ Iterator< true >

friend class Iterator< true >
friend

Allow iterator access to internals.

Definition at line 521 of file UPtrList.H.

Referenced by UPtrList< const Foam::UList >::begin(), and UPtrList< const Foam::UList >::cbegin().

◆ Iterator< false >

friend class Iterator< false >
friend

Allow iterator access to internals.

Definition at line 531 of file UPtrList.H.

Referenced by UPtrList< const Foam::UList >::begin().

◆ operator

Ostream& operator ( Ostream os,
const UPtrList< T > &  list 
)
friend

Write UPtrList to Ostream.

Member Data Documentation

◆ ptrs_


The documentation for this class was generated from the following files: