A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used for subscript bounds checking, etc. More...
Classes | |
class | const_iterator |
An STL-conforming const_iterator. More... | |
class | iterator |
An STL iterator. More... | |
Public Types | |
typedef T | value_type |
Type of values the UPtrList contains. More... | |
typedef T & | reference |
Type that can be used for storing into UPtrList::value_type objects. More... | |
typedef const T & | const_reference |
Type that can be used for storing into constant UPtrList::value_type. More... | |
Public Member Functions | |
UPtrList () | |
Null Constructor. More... | |
UPtrList (const label) | |
Construct with size specified. More... | |
UPtrList (UPtrList< T > &, bool reuse) | |
Construct as copy or reuse as specified. More... | |
label | size () const |
Return the number of elements in the UPtrList. More... | |
bool | empty () const |
Return true if the UPtrList 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 | setSize (const label) |
Reset size of UPtrList. This can only be used to set the size. More... | |
void | resize (const label) |
Reset size of UPtrList. This can only be used to set the size. More... | |
void | clear () |
Clear the UPtrList, i.e. set size to zero. More... | |
void | append (T *) |
Append an element at the end of the list. More... | |
void | transfer (UPtrList< T > &) |
Transfer the contents of the argument UPtrList into this. More... | |
bool | set (const label) const |
Is element set. More... | |
T * | set (const label, T *) |
Set element. Return old element (can be nullptr). More... | |
void | reorder (const labelUList &oldToNew) |
Reorders elements. Ordering does not have to be done in. More... | |
void | shuffle (const labelUList &newToOld) |
Reorders elements. Ordering does not have to be done in. More... | |
template<class T2 > | |
UPtrList< T2 > | convert () |
Convert to list of different pointer type. More... | |
template<class T2 > | |
UPtrList< const T2 > | convert () const |
Convert to list of different pointer type. More... | |
const T & | operator[] (const label) const |
Return element const reference. More... | |
T & | operator[] (const label) |
Return element reference. More... | |
const T * | operator() (const label) const |
Return element const pointer. More... | |
T * | operator() (const label) |
Return element const pointer. 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... | |
template<class T2 > | |
Foam::UPtrList< T2 > | convert () |
template<class T2 > | |
Foam::UPtrList< const T2 > | convert () const |
Friends | |
class | PtrList< T > |
Declare friendship with the PtrList class. More... | |
class | iterator |
Ostream & | operator (Ostream &, const UPtrList< T > &) |
Write UPtrList to Ostream. More... | |
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used for subscript bounds checking, etc.
The element operator [] returns a reference to the object rather than a pointer. Storage is not allocated during construction or use but is supplied to the constructor as an argument.
Definition at line 65 of file UPtrList.H.
typedef T value_type |
Type of values the UPtrList contains.
Definition at line 184 of file UPtrList.H.
Type that can be used for storing into UPtrList::value_type objects.
Definition at line 187 of file UPtrList.H.
typedef const T& const_reference |
Type that can be used for storing into constant UPtrList::value_type.
objects
Definition at line 191 of file UPtrList.H.
Null Constructor.
Definition at line 31 of file UPtrList.C.
Construct with size specified.
Definition at line 38 of file UPtrList.C.
Construct as copy or reuse as specified.
Definition at line 45 of file UPtrList.C.
|
inline |
Return the number of elements in the UPtrList.
Definition at line 29 of file UPtrListI.H.
Referenced by singleProcessorFaceSetsConstraint::add(), fvMeshAdder::add(), polyMeshAdder::add(), surfaceZonesInfo::addCellZonesToMesh(), surfaceZonesInfo::addFaceZonesToMesh(), snappyLayerDriver::addLayers(), meshRefinement::addMeshedPatch(), pointMesh::addPatch(), fvMeshTools::addPatch(), GAMGAgglomeration::agglomerateLduAddressing(), extendedEdgeMesh::allNearestFeatureEdges(), AveragingMethod< Type >::AveragingMethod(), nearWallFields::calcAddressing(), addPatchCellLayer::calcSidePatch(), fvMotionSolver::cellMotionBoundaryTypes(), polyTopoChange::changeMesh(), polyBoundaryMesh::checkParallelSync(), Foam::meshCheck::checkTopology(), GAMGAgglomeration::compactLevels(), pointDist::correct(), motionSmootherAlgo::curPoints(), cutPolyIsoSurface::cutPolyIsoSurface(), structured::decompose(), decompositionMethod::decompose(), fvMeshDistribute::distribute(), snappyLayerDriver::doLayers(), polyBoundaryMesh::findIndices(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), surfaceZonesInfo::getAllClosedNamedSurfaces(), surfaceZonesInfo::getClosedNamedSurfaces(), surfaceZonesInfo::getInsidePointNamedSurfaces(), surfaceZonesInfo::getNamedSurfaces(), surfaceZonesInfo::getUnclosedNamedSurfaces(), surfaceZonesInfo::getUnnamedSurfaces(), GAMGProcAgglomeration::globalCellCells(), basicThermo::heBoundaryBaseTypes(), hexRef8Data::hexRef8Data(), LocalInteraction< CloudType >::info(), lduMatrix::initMatrixInterfaces(), faceZoneList::insert(), singleCellFvMesh::interpolate(), volPointInterpolation::interpolateUnconstrained(), MomentumTransferPhaseSystem< BasePhaseSystem >::invADVfs(), MomentumTransferPhaseSystem< BasePhaseSystem >::invADVs(), rigidBodyModel::join(), layerParameters::layerParameters(), lduPrimitiveMesh::lduPrimitiveMesh(), Foam::MULES::limitSum(), LUscalarMatrix::LUscalarMatrix(), meshRefinement::makeDisplacementField(), polyTopoChange::makeMesh(), MRFPatchField::MRFzone(), extendedEdgeMesh::nearestFeatureEdgeByType(), lduPrimitiveMesh::nonBlockingSchedule(), nonConformalBoundary::nonConformalOtherPatchIndices(), processorRunTimes::nProcs(), populationBalanceModel::groups::nSizeGroups(), Foam::operator<<(), PtrList< T >::operator=(), patchDistMethod::patchTypes(), polyBoundaryMesh::physicalTypes(), polyBoundaryMesh::polyBoundaryMesh(), polyMesh::polyMesh(), Foam::polyMeshUnMergeCyclics(), fvMeshDistribute::printMeshInfo(), Foam::meshCheck::printMeshStats(), PtrListDictionary< T >::PtrListDictionary(), Fickian< BasicThermophysicalTransportModel >::q(), MaxwellStefan< BasicThermophysicalTransportModel >::q(), nonUnityLewisEddyDiffusivity< TurbulenceThermophysicalTransportModel >::q(), repatchMesh::read(), polyMesh::readUpdate(), ensightParts::recalculate(), refinementHistory::refinementHistory(), refinementSurfaces::refinementSurfaces(), structuredRenumber::renumber(), pointBoundaryMesh::reset(), GeometricBoundaryField< Type, PatchField, GeoMesh >::reset(), filmCloudTransfer::resetFromCloudFields(), lduMatrix::residual(), triSurfaceMesh::sampleField(), sampledSurfaces::sampleType(), GeometricFieldListSlicer< Type, PatchField, GeoMesh >::set(), fvMeshSubset::setCellSubset(), polyBoundaryMesh::setGroup(), fvMeshSubset::setLargeCellSubset(), removeCells::setRefinement(), singleCellFvMesh::singleCellFvMesh(), ensightParts::size(), FieldListSlice< Type >::size(), phaseSystem::solve(), fvMeshToFvMesh::srcToTgt(), phaseSystem::sumAlphaMoving(), surfacePatchIOList::surfacePatchIOList(), surfZoneIOList::surfZoneIOList(), fvMesh::swap(), polyMesh::swap(), polyBoundaryMesh::toc(), GeometricBoundaryField< Type, PatchField, GeoMesh >::types(), polyBoundaryMesh::types(), conformedFvsPatchField< Type >::unconform(), lduMatrix::updateMatrixInterfaces(), UPtrListDictionary< T >::UPtrListDictionary(), Foam::vertices(), volPointInterpolation::volPointInterpolation(), populationBalanceSizeDistribution::write(), OFstreamCollator::write(), polyBoundaryMesh::writeData(), ensightParts::writeField(), cellZoneSet::writeObject(), faceZoneSet::writeObject(), pointZoneSet::writeObject(), meshRefinement::zonify(), and subCycleFields< GeometricField >::~subCycleFields().
|
inline |
Return true if the UPtrList is empty (ie, size() is zero)
Definition at line 36 of file UPtrListI.H.
|
inline |
Return reference to the first element of the list.
Definition at line 43 of file UPtrListI.H.
Referenced by blendingMethod::constant().
|
inline |
Return reference to first element of the list.
Definition at line 50 of file UPtrListI.H.
|
inline |
Return reference to the last element of the list.
Definition at line 57 of file UPtrListI.H.
|
inline |
Return reference to the last element of the list.
Definition at line 64 of file UPtrListI.H.
void setSize | ( | const label | newSize | ) |
Reset size of UPtrList. This can only be used to set the size.
of an empty UPtrList, extend a UPtrList, remove entries from the end of a UPtrList
Definition at line 54 of file UPtrList.C.
References clear().
Referenced by fvMesh::curFields(), fvMesh::fields(), lduPrimitiveMesh::lduPrimitiveMesh(), phaseSystem::solve(), and UPtrListDictionary< T >::UPtrListDictionary().
|
inline |
Reset size of UPtrList. This can only be used to set the size.
of an empty UPtrList, extend a UPtrList, remove entries from the end of a UPtrList
Definition at line 71 of file UPtrListI.H.
References setSize().
Referenced by populationBalanceModel::groups::insert(), phaseSystem::phaseSystem(), and GeometricFieldListSlicer< Type, PatchField, GeoMesh >::set().
void clear |
Clear the UPtrList, i.e. set size to zero.
Definition at line 80 of file UPtrList.C.
|
inline |
Append an element at the end of the list.
Definition at line 78 of file UPtrListI.H.
References setSize().
Transfer the contents of the argument UPtrList into this.
UPtrList and annul the argument list
Definition at line 87 of file UPtrList.C.
Referenced by populationBalanceModel::groups::retrieve().
|
inline |
Is element set.
Definition at line 87 of file UPtrListI.H.
Referenced by GAMGAgglomeration::agglomerateLduAddressing(), GAMGAgglomeration::combineLevels(), GAMGAgglomeration::compactLevels(), UPtrList< T >::convert(), fvMesh::curFields(), fvMesh::fields(), GAMGSolver::GAMGSolver(), lduPrimitiveMesh::gather(), GeometricBoundaryField< label, Foam::fvsPatchField, Foam::surfaceMesh >::GeometricBoundaryField(), GAMGProcAgglomeration::globalCellCells(), hexRef8Data::hexRef8Data(), lduMatrix::initMatrixInterfaces(), populationBalanceModel::groups::insert(), fvBoundaryMesh::interfaces(), GeometricBoundaryField< Type, PatchField, GeoMesh >::interfaces(), lduPrimitiveMesh::lduPrimitiveMesh(), Foam::MULES::limitSum(), nonBlockingGaussSeidelSmoother::nonBlockingGaussSeidelSmoother(), lduPrimitiveMesh::nonBlockingSchedule(), Foam::operator<<(), phaseSystem::phaseSystem(), procLduMatrix::procLduMatrix(), GeometricBoundaryField< Type, PatchField, GeoMesh >::readField(), lduMatrix::residual(), GeometricBoundaryField< Type, PatchField, GeoMesh >::scalarInterfaces(), GeometricFieldListSlicer< Type, PatchField, GeoMesh >::set(), nonBlockingGaussSeidelSmoother::smooth(), GaussSeidelSmoother::smooth(), symGaussSeidelSmoother::smooth(), phaseSystem::solve(), lduMatrix::sumA(), lduMatrix::updateMatrixInterfaces(), and domainDecomposition::writeComplete().
Set element. Return old element (can be nullptr).
No checks on new element
Definition at line 94 of file UPtrListI.H.
References Foam::T().
void reorder | ( | const labelUList & | oldToNew | ) |
Reorders elements. Ordering does not have to be done in.
ascending or descending order. Reordering has to be unique. (is shuffle)
Definition at line 94 of file UPtrList.C.
References Foam::abort(), Foam::FatalError, FatalErrorInFunction, forAll, Foam::nl, UList< T >::size(), and Foam::T().
void shuffle | ( | const labelUList & | newToOld | ) |
Reorders elements. Ordering does not have to be done in.
ascending or descending order. Reordering has to be unique. Note: can create unset elements
Definition at line 142 of file UPtrList.C.
References forAll, UList< T >::size(), and Foam::T().
UPtrList<T2> convert | ( | ) |
Convert to list of different pointer type.
UPtrList<const T2> convert | ( | ) | const |
Convert to list of different pointer type.
Return element const reference.
Definition at line 105 of file UPtrListI.H.
Referenced by sampledSets::sampleLocalType(), and sampledSurfaces::sampleLocalType().
Return element reference.
Definition at line 121 of file UPtrListI.H.
Return element const pointer.
Definition at line 137 of file UPtrListI.H.
Return element const pointer.
Definition at line 144 of file UPtrListI.H.
|
inline |
Return an iterator to begin traversing the UPtrList.
Definition at line 308 of file UPtrListI.H.
|
inline |
Return an iterator to end traversing the UPtrList.
Definition at line 316 of file UPtrListI.H.
References UList< T >::end().
|
inline |
Return an const_iterator to begin traversing the UPtrList.
Definition at line 521 of file UPtrListI.H.
References UList< T >::begin().
|
inline |
Return an const_iterator to end traversing the UPtrList.
Definition at line 529 of file UPtrListI.H.
References UList< T >::end().
|
inline |
Return an const_iterator to begin traversing the UPtrList.
Definition at line 505 of file UPtrListI.H.
References UList< T >::begin().
|
inline |
Return an const_iterator to end traversing the UPtrList.
Definition at line 513 of file UPtrListI.H.
References UList< T >::end().
Foam::UPtrList<T2> convert | ( | ) |
Definition at line 162 of file UPtrList.C.
References forAll, and UPtrList< T >::set().
Foam::UPtrList<const T2> convert | ( | ) | const |
Definition at line 175 of file UPtrList.C.
References forAll, and UPtrList< T >::set().
Declare friendship with the PtrList class.
Definition at line 69 of file UPtrList.H.
|
friend |
Definition at line 199 of file UPtrList.H.