DynamicList< T, SizeMin > Class Template Reference

A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects. More...

Public Member Functions

constexpr DynamicList () noexcept
 Default construct, an empty list without allocation. More...
 
 DynamicList (const label nElem)
 Construct an empty list with given reserve size. More...
 
 DynamicList (const label nElem, const T &val)
 Construct with given size and value for all elements. More...
 
 DynamicList (const label nElem, const Foam::zero)
 Construct with given size initializing all elements to zero. More...
 
 DynamicList (const DynamicList< T, SizeMin > &lst)
 Copy construct. More...
 
template<int AnySizeMin>
 DynamicList (const DynamicList< T, AnySizeMin > &lst)
 Copy construct from DynamicList with different sizing parameters. More...
 
 DynamicList (const UList< T > &lst)
 Construct from UList. Size set to UList size. More...
 
template<unsigned N>
 DynamicList (const FixedList< T, N > &lst)
 Construct from a FixedList. More...
 
template<class InputIterator >
 DynamicList (InputIterator begIter, InputIterator endIter)
 Construct given begin/end iterators. More...
 
 DynamicList (std::initializer_list< T > lst)
 Construct from an initializer list. Size set to list size. More...
 
template<class Addr >
 DynamicList (const IndirectListBase< T, Addr > &lst)
 Construct from IndirectList. Size set to addressing size. More...
 
 DynamicList (DynamicList< T, SizeMin > &&lst)
 Move construct. More...
 
template<int AnySizeMin>
 DynamicList (DynamicList< T, AnySizeMin > &&lst)
 Move construct with different sizing parameters. More...
 
 DynamicList (List< T > &&lst)
 Move construct from List. More...
 
 DynamicList (SortableList< T > &&lst)
 Move construct from SortableList. More...
 
 DynamicList (Istream &is)
 Construct from Istream. Size set to size of list read. More...
 
label capacity () const noexcept
 Size of the underlying storage. More...
 
void setCapacity (const label nElem)
 Alter the size of the underlying storage. More...
 
void setSize (const label nElem)
 Alter addressable list size. More...
 
void setSize (const label nElem, const T &val)
 Alter addressable list size and fill new space with constant. More...
 
void resize (const label nElem)
 Alter addressable list size. More...
 
void resize (const label nElem, const T &val)
 Alter addressable list size and fill new space with constant. More...
 
void reserve (const label nElem)
 Reserve allocation space for at least this size. More...
 
void clear ()
 Clear the addressed list, i.e. set the size to zero. More...
 
void clearStorage ()
 Clear the list and delete storage. More...
 
label expandStorage ()
 Expand the addressable size to fit the allocated capacity. More...
 
DynamicList< T, SizeMin > & shrink ()
 Shrink the allocated space to the number of elements used. More...
 
template<int AnySizeMin>
void swap (DynamicList< T, AnySizeMin > &lst)
 Swap content with any sized DynamicList. More...
 
void transfer (List< T > &lst)
 Transfer contents of the argument List into this. More...
 
template<int AnySizeMin>
void transfer (DynamicList< T, AnySizeMin > &lst)
 Transfer contents of any sized DynamicList into this. More...
 
void transfer (SortableList< T > &lst)
 Transfer contents of the argument SortableList into this. More...
 
DynamicList< T, SizeMin > & append (const T &val)
 Append an element to the end of this list. More...
 
DynamicList< T, SizeMin > & append (T &&val)
 Move append an element. More...
 
DynamicList< T, SizeMin > & append (const UList< T > &lst)
 Append another list to the end of this list. More...
 
template<unsigned N>
DynamicList< T, SizeMin > & append (const FixedList< T, N > &lst)
 Append a FixedList to the end of this list. More...
 
DynamicList< T, SizeMin > & append (std::initializer_list< T > lst)
 Append an initializer list at the end of this list. More...
 
template<class Addr >
DynamicList< T, SizeMin > & append (const IndirectListBase< T, Addr > &lst)
 Append a IndirectList at the end of this list. More...
 
DynamicList< T, SizeMin > & append (List< T > &&lst)
 Move append list. More...
 
DynamicList< T, SizeMin > & append (DynamicList< T, SizeMin > &&lst)
 Move append list. More...
 
template<int AnySizeMin>
DynamicList< T, SizeMin > & append (DynamicList< T, AnySizeMin > &&lst)
 Move append list. More...
 
DynamicList< T, SizeMin > & append (SortableList< T > &&lst)
 Move append list. More...
 
T remove ()
 Remove and return the last element. Fatal on an empty list. More...
 
T remove (const label idx, const bool fast=false)
 Remove and return the specified element. Fatal on an empty list. More...
 
label remove (const labelRange &range)
 Remove a (start,size) subset from the list. More...
 
label remove (std::initializer_list< label > start_size)
 Remove a (start,size) subset from the list. More...
 
label subset (const labelRange &range)
 Retain a (start,size) subset from the list. More...
 
label subset (std::initializer_list< label > start_size)
 Retain a (start,size) subset from List. More...
 
Toperator() (const label i)
 
void operator= (const T &val)
 Assignment of all addressed entries to the given value. More...
 
void operator= (const Foam::zero)
 Assignment of all entries to zero. More...
 
void operator= (const UList< T > &lst)
 Assignment to UList. More...
 
template<unsigned N>
void operator= (const FixedList< T, N > &lst)
 Assignment to FixedList. More...
 
void operator= (const DynamicList< T, SizeMin > &lst)
 Assignment to DynamicList. More...
 
template<int AnySizeMin>
void operator= (const DynamicList< T, AnySizeMin > &lst)
 Assignment from DynamicList with different sizing parameters. More...
 
void operator= (std::initializer_list< T > lst)
 Assignment from initializer list. More...
 
template<class Addr >
void operator= (const IndirectListBase< T, Addr > &lst)
 Assignment from IndirectList. More...
 
void operator= (List< T > &&lst)
 Move assignment. More...
 
void operator= (DynamicList< T, SizeMin > &&lst)
 Move assignment. More...
 
template<int AnySizeMin>
void operator= (DynamicList< T, AnySizeMin > &&lst)
 Move assignment. More...
 
void operator= (SortableList< T > &&lst)
 Move assignment. More...
 
template<unsigned N>
Foam::DynamicList< T, SizeMin > & append (const FixedList< T, N > &lst)
 
template<class Addr>
Foam::DynamicList< T, SizeMin > & append (const IndirectListBase< T, Addr > &lst)
 
template<int AnySizeMin>
Foam::DynamicList< T, SizeMin > & append (DynamicList< T, AnySizeMin > &&lst)
 

Static Public Member Functions

static constexpr label min_size () noexcept
 Normal lower capacity limit - the SizeMin template parameter. More...
 

Protected Member Functions

template<class ListType >
void assignDynList (const ListType &lst)
 Copy assignment from another list. More...
 

Friends

class List< T >
 Declare friendship with the List class. More...
 
Ostreamoperator (Ostream &os, const DynamicList< T, SizeMin > &lst)
 
Istreamoperator>> (Istream &is, DynamicList< T, SizeMin > &lst)
 Read from Istream, discarding contents of existing DynamicList. More...
 

Detailed Description

template<class T, int SizeMin = 16>
class Foam::DynamicList< T, SizeMin >

A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.

Internal storage is a compact array and the list can be shrunk to compact storage. The increase of list size uses a doubling strategy, with the SizeMin template parameter dictating a lower bound.

Source files

Definition at line 55 of file DynamicList.H.

Constructor & Destructor Documentation

◆ DynamicList() [1/16]

constexpr DynamicList ( )
inlineconstexprnoexcept

Default construct, an empty list without allocation.

Definition at line 62 of file DynamicListI.H.

◆ DynamicList() [2/16]

DynamicList ( const label  nElem)
inlineexplicit

Construct an empty list with given reserve size.

Definition at line 69 of file DynamicListI.H.

◆ DynamicList() [3/16]

DynamicList ( const label  nElem,
const T val 
)
inline

Construct with given size and value for all elements.

Definition at line 79 of file DynamicListI.H.

◆ DynamicList() [4/16]

DynamicList ( const label  nElem,
const Foam::zero   
)
inline

Construct with given size initializing all elements to zero.

Definition at line 91 of file DynamicListI.H.

◆ DynamicList() [5/16]

DynamicList ( const DynamicList< T, SizeMin > &  lst)
inline

Copy construct.

Definition at line 103 of file DynamicListI.H.

◆ DynamicList() [6/16]

DynamicList ( const DynamicList< T, AnySizeMin > &  lst)
inline

Copy construct from DynamicList with different sizing parameters.

Definition at line 115 of file DynamicListI.H.

◆ DynamicList() [7/16]

DynamicList ( const UList< T > &  lst)
inlineexplicit

Construct from UList. Size set to UList size.

Also constructs from DynamicList with different sizing parameters.

Definition at line 126 of file DynamicListI.H.

◆ DynamicList() [8/16]

DynamicList ( const FixedList< T, N > &  lst)
inline

Construct from a FixedList.

Definition at line 138 of file DynamicListI.H.

◆ DynamicList() [9/16]

DynamicList ( InputIterator  begIter,
InputIterator  endIter 
)
inline

Construct given begin/end iterators.

Uses std::distance to determine the size.

Definition at line 151 of file DynamicListI.H.

◆ DynamicList() [10/16]

DynamicList ( std::initializer_list< T lst)
inlineexplicit

Construct from an initializer list. Size set to list size.

Definition at line 163 of file DynamicListI.H.

◆ DynamicList() [11/16]

DynamicList ( const IndirectListBase< T, Addr > &  lst)
inlineexplicit

Construct from IndirectList. Size set to addressing size.

Definition at line 175 of file DynamicListI.H.

◆ DynamicList() [12/16]

DynamicList ( DynamicList< T, SizeMin > &&  lst)
inline

Move construct.

Definition at line 186 of file DynamicListI.H.

◆ DynamicList() [13/16]

DynamicList ( DynamicList< T, AnySizeMin > &&  lst)
inline

Move construct with different sizing parameters.

Definition at line 199 of file DynamicListI.H.

◆ DynamicList() [14/16]

DynamicList ( List< T > &&  lst)
inline

Move construct from List.

Definition at line 211 of file DynamicListI.H.

◆ DynamicList() [15/16]

DynamicList ( SortableList< T > &&  lst)

Move construct from SortableList.

◆ DynamicList() [16/16]

DynamicList ( Istream is)
explicit

Construct from Istream. Size set to size of list read.

Definition at line 95 of file DynamicList.C.

Member Function Documentation

◆ assignDynList()

void assignDynList ( const ListType &  lst)
inlineprotected

Copy assignment from another list.

Definition at line 36 of file DynamicListI.H.

◆ min_size()

static constexpr label min_size ( )
inlinestaticconstexprnoexcept

Normal lower capacity limit - the SizeMin template parameter.

Definition at line 177 of file DynamicList.H.

◆ capacity()

Foam::label capacity ( ) const
inlinenoexcept

Size of the underlying storage.

Definition at line 224 of file DynamicListI.H.

Referenced by primitiveMesh::cellEdges(), primitiveMesh::cellPoints(), extendedEdgeMesh::cut(), primitiveMesh::faceEdges(), primitiveMesh::pointPoints(), DynamicField< Foam::Vector >::transfer(), and DynamicList< Foam::triPoints >::transfer().

Here is the caller graph for this function:

◆ setCapacity()

void setCapacity ( const label  nElem)
inline

Alter the size of the underlying storage.

The addressed size will be truncated if needed to fit, but will remain otherwise untouched. Use this or reserve() in combination with append().

Definition at line 232 of file DynamicListI.H.

Referenced by primitiveMesh::cellEdges(), primitiveMesh::cellPoints(), extendedEdgeMesh::cut(), primitiveMesh::faceEdges(), fileMonitorWatcher::fileMonitorWatcher(), primitiveMesh::pointPoints(), Pstream::Pstream(), surfaceFeatures::selectFeatureEdges(), PatchTools::sortedPointEdges(), extendedEdgeMesh::sortPointsAndEdges(), and DynamicList< Foam::triPoints >::swap().

Here is the caller graph for this function:

◆ setSize() [1/2]

void setSize ( const label  nElem)
inline

Alter addressable list size.

New space will be allocated if required. Use this to resize the list prior to using the operator[] for setting values (as per List usage).

Definition at line 282 of file DynamicListI.H.

Referenced by chemPointISAT< CompType, ThermoType >::grow(), primitiveMesh::pointCells(), OBJedgeFormat::read(), EFA< CompType, ThermoType >::reduceMechanism(), PFA< CompType, ThermoType >::reduceMechanism(), DAC< CompType, ThermoType >::reduceMechanism(), DRGEP< CompType, ThermoType >::reduceMechanism(), refinementHistory::refinementHistory(), DynamicList< Foam::triPoints >::swap(), face::triangles(), streamLineBase::trimToBox(), WallLocalSpringSliderDashpot< CloudType >::WallLocalSpringSliderDashpot(), and streamLineBase::writeToFile().

Here is the caller graph for this function:

◆ setSize() [2/2]

void setSize ( const label  nElem,
const T val 
)
inline

Alter addressable list size and fill new space with constant.

Definition at line 310 of file DynamicListI.H.

◆ resize() [1/2]

void resize ( const label  nElem)
inline

Alter addressable list size.

New space will be allocated if required. Use this to resize the list prior to using the operator[] for setting values (as per List usage).

Definition at line 328 of file DynamicListI.H.

Referenced by lumpedPointMovement::setInterpolator(), cuttingSurfaceBase::walkCellCuts(), and profiling::writeData().

Here is the caller graph for this function:

◆ resize() [2/2]

void resize ( const label  nElem,
const T val 
)
inline

Alter addressable list size and fill new space with constant.

Definition at line 338 of file DynamicListI.H.

◆ reserve()

void reserve ( const label  nElem)
inline

Reserve allocation space for at least this size.

Never shrinks the allocated size, use setCapacity() for that.

Definition at line 254 of file DynamicListI.H.

Referenced by STARCDsurfaceFormat< Face >::read(), and STARCDedgeFormat::read().

Here is the caller graph for this function:

◆ clear()

void clear ( )
inline

Clear the addressed list, i.e. set the size to zero.

Allocated size does not change

Definition at line 348 of file DynamicListI.H.

Referenced by Foam::bandCompression(), isoAdvection::boundFlux(), faceAreaWeightAMI::calcAddressing(), correctedCellVolumeWeightMethod::calculateAddressing(), cellVolumeWeightMethod::calculateAddressing(), mapNearestMethod::calculateAddressing(), primitiveMesh::cellCells(), primitiveMesh::cellEdges(), primitiveMesh::cellPoints(), obstacleGrouping::clear(), ABAQUSCore::readHelper::clear(), probes::clearFieldGroups(), snappySnapDriver::doSnap(), primitiveMesh::edgeCells(), primitiveMesh::edgeFaces(), NASCore::faceDecomposition(), ABAQUSCore::faceDecomposition(), primitiveMesh::faceEdges(), triSurfaceSearch::findLineAll(), searchableBox::findLineAll(), searchableRotatedBox::findLineAll(), cellDistFuncs::getPointNeighbours(), indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::indexedOctree(), csvTableReader< Type >::operator()(), OppositeFaceCellWave< Type, TrackingData >::opposingFaceLabels(), primitiveMesh::pointCells(), primitiveMesh::pointPoints(), OBJsurfaceFormat< Face >::read(), STARCDsurfaceFormat< Face >::read(), NASsurfaceFormat< Face >::read(), STARCDedgeFormat::read(), Foam::readObjVertices(), STARCDCore::readPoints(), faceAreaWeightAMI::restartUncoveredSourceFace(), OTstream::rewind(), lumpedPointMovement::setInterpolator(), Reaction< ReactionThermo >::setLRhs(), PatchTools::sortedPointEdges(), MeshedSurface< Foam::face >::sortFacesAndStore(), patchInjectionBase::updateMesh(), cuttingSurfaceBase::walkCellCuts(), and externalCoupled::writeGeometry().

Here is the caller graph for this function:

◆ clearStorage()

void clearStorage ( )
inline

Clear the list and delete storage.

Definition at line 355 of file DynamicListI.H.

Referenced by isoSurfaceTopo::isoSurfaceTopo(), Foam::operator>>(), NASedgeFormat::read(), NASsurfaceFormat< Face >::read(), DynamicField< Foam::Vector >::transfer(), DynamicList< Foam::triPoints >::transfer(), and List< substance >::transfer().

Here is the caller graph for this function:

◆ expandStorage()

Foam::label expandStorage ( )
inline

Expand the addressable size to fit the allocated capacity.

Returns the previous addressable size.

Definition at line 363 of file DynamicListI.H.

Referenced by DynamicList< Foam::triPoints >::swap().

Here is the caller graph for this function:

◆ shrink()

◆ swap()

void swap ( DynamicList< T, AnySizeMin > &  lst)
inline

Swap content with any sized DynamicList.

Definition at line 396 of file DynamicListI.H.

Referenced by Foam::Swap().

Here is the caller graph for this function:

◆ transfer() [1/3]

void transfer ( List< T > &  lst)
inline

Transfer contents of the argument List into this.

Definition at line 427 of file DynamicListI.H.

Referenced by curvatureSeparation::curvatureSeparation(), isoSurfaceTopo::isoSurfaceTopo(), ReactingMultiphaseParcel< ParcelType >::ReactingMultiphaseParcel(), ReactingParcel< ParcelType >::ReactingParcel(), OBJsurfaceFormat< Face >::read(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::removeIndex(), and streamLineBase::writeToFile().

Here is the caller graph for this function:

◆ transfer() [2/3]

void transfer ( DynamicList< T, AnySizeMin > &  lst)
inline

Transfer contents of any sized DynamicList into this.

Definition at line 439 of file DynamicListI.H.

◆ transfer() [3/3]

void transfer ( SortableList< T > &  lst)
inline

Transfer contents of the argument SortableList into this.

Definition at line 461 of file DynamicListI.H.

◆ append() [1/13]

Foam::DynamicList< T, SizeMin > & append ( const T val)
inline

Append an element to the end of this list.

Definition at line 474 of file DynamicListI.H.

Referenced by AABBTree< Type >::AABBTree(), ISAT< CompType, ThermoType >::add(), cellZoneSet::addSet(), pointZoneSet::addSet(), faceZoneSet::addSet(), fileOperation::addWatches(), masterUncollatedFileOperation::addWatches(), meshToMeshMethod::appendNbrCells(), advancingFrontAMI::appendNbrFaces(), directMethod::appendToDirectSeeds(), setToCellZone::applyToSet(), setToPointZone::applyToSet(), setAndNormalToFaceZone::applyToSet(), setToFaceZone::applyToSet(), extendedEdgeMesh::autoMap(), Foam::bandCompression(), STLAsciiParse::beginSolid(), PDRblock::blockMeshDict(), isoAdvection::boundFlux(), box::box(), faceAreaWeightAMI::calcAddressing(), cutCell::calcIsoFacePointsFromEdges(), mappedPatchBase::calcMapping(), cutFace::calcSubFace(), viewFactor::calculate(), correctedCellVolumeWeightMethod::calculateAddressing(), cellVolumeWeightMethod::calculateAddressing(), mapNearestMethod::calculateAddressing(), primitiveMesh::cellCells(), primitiveMesh::cellEdges(), primitiveMesh::cellPoints(), polyMeshTetDecomposition::cellTetIndices(), collectLibsCallback(), patchPatchDist::correct(), AABBTree< Type >::createBoxes(), geomCellLooper::cut(), extendedEdgeMesh::cut(), cutFaceAdvect::cutPoints(), Foam::dlLoaded(), snappySnapDriver::doSnap(), extendedEdgeMesh::edgeBaffles(), primitiveMesh::edgeCells(), primitiveMesh::edgeFaces(), ifeqEntry::execute(), primitiveMesh::faceEdges(), OppositeFaceCellWave< Type, TrackingData >::faceToCell(), triSurfaceSearch::findLineAll(), searchableBox::findLineAll(), searchableRotatedBox::findLineAll(), mapNearestMethod::findMappedSrcCell(), mapNearestMethod::findNearestCell(), UPstream::freeTag(), isoSurfacePoint::generateFaceTriPoints(), ensightSurfaceReader::geometry(), removeCells::getExposedFaces(), externalDisplacementMeshMover::getFixedValueBCs(), boundaryMesh::getNearest(), incompressiblePrimalSolver::getObjectiveFunctions(), cellDistFuncs::getPointNeighbours(), distributedTriSurfaceMesh::getVolumeType(), chemPointISAT< CompType, ThermoType >::grow(), indexedOctree< Foam::treeDataPrimitivePatch< PatchType > >::indexedOctree(), polyBoundaryMesh::indices(), fluxSummary::initialiseCellZoneAndDirection(), fluxSummary::initialiseFaceZone(), fluxSummary::initialiseFaceZoneAndDirection(), fluxSummary::initialiseSurface(), fluxSummary::initialiseSurfaceAndDirection(), meshSearch::intersections(), isoSurfaceTopo::isoSurfaceTopo(), fileOperation::lookupAndCacheProcessorsPath(), Foam::lumpedPointTools::lumpedPointStates(), trackingInverseDistance::markDonors(), inverseDistance::markDonors(), polyBoundaryMesh::matchGroups(), meshRefinement::mergeZoneBaffles(), fvMeshTools::newMesh(), stateFunctionObject::objectResultEntries(), csvTableReader< Type >::operator()(), sampledSurface::iNewCapture::operator()(), listOp< N >::result::operator+(), OppositeFaceCellWave< Type, TrackingData >::opposingFaceLabels(), sampledPatch::patchIDs(), patchInteractionDataList::patchInteractionDataList(), primitiveMesh::pointCells(), primitiveMesh::pointPoints(), ProcessorTopology< Container, ProcPatch >::ProcessorTopology(), faceAreaWeightAMI::processSourceFace(), OBJsurfaceFormat< Face >::read(), OBJedgeFormat::read(), NASedgeFormat::read(), OFFsurfaceFormat< Face >::read(), ABAQUSsurfaceFormat< Face >::read(), AC3DsurfaceFormat< Face >::read(), STARCDsurfaceFormat< Face >::read(), NASsurfaceFormat< Face >::read(), STARCDedgeFormat::read(), VTKsurfaceFormat< Face >::read(), masterUncollatedFileOperation::read(), ensightSurfaceReader::readCase(), Foam::readObjVertices(), STARCDCore::readPoints(), FIREMeshReader::readSelections(), box::refineBox(), searchableSurfaceCollection::regions(), regionSplit2D::regionSplit2D(), dynamicIndexedOctree< Foam::dynamicTreeDataPoint >::removeIndex(), dynamicCode::resolveTemplates(), surfaceFeatures::selectFeatureEdges(), dynamicRefineFvMesh::selectRefineCells(), dynamicRefineFvMesh::selectUnrefinePoints(), boundaryMesh::setFeatureEdges(), lumpedPointMovement::setInterpolator(), Reaction< ReactionThermo >::setLRhs(), box::setRefineFlags(), faceCollapser::setRefinement(), boundaryCutter::setRefinement(), createShellMesh::setRefinement(), hexRef8::setRefinement(), ifeqEntry::skipUntil(), PatchTools::sortedPointEdges(), extendedEdgeMesh::sortPointsAndEdges(), streamLineBase::storePoint(), masterUncollatedFileOperation::subRanks(), reconstructionSchemes::surface(), surfaceIntersection::surfaceIntersection(), faceAreaIntersect::triangleFan(), streamLineBase::trimToBox(), refinementParameters::unzonedLocations(), trackingInverseDistance::update(), CollisionRecordList< vector, vector >::update(), inverseDistance::update(), probes::updateMesh(), cuttingSurfaceBase::walkCellCuts(), wallLayerCells::wallLayerCells(), WallLocalSpringSliderDashpot< CloudType >::WallLocalSpringSliderDashpot(), and externalCoupled::writeGeometry().

◆ append() [2/13]

Foam::DynamicList< T, SizeMin > & append ( T &&  val)
inline

Move append an element.

Definition at line 489 of file DynamicListI.H.

◆ append() [3/13]

Foam::DynamicList< T, SizeMin > & append ( const UList< T > &  lst)
inline

Append another list to the end of this list.

Definition at line 504 of file DynamicListI.H.

◆ append() [4/13]

DynamicList<T, SizeMin>& append ( const FixedList< T, N > &  lst)
inline

Append a FixedList to the end of this list.

◆ append() [5/13]

Foam::DynamicList< T, SizeMin > & append ( std::initializer_list< T lst)
inline

Append an initializer list at the end of this list.

Definition at line 548 of file DynamicListI.H.

◆ append() [6/13]

DynamicList<T, SizeMin>& append ( const IndirectListBase< T, Addr > &  lst)
inline

Append a IndirectList at the end of this list.

◆ append() [7/13]

Foam::DynamicList< T, SizeMin > & append ( List< T > &&  lst)
inline

Move append list.

Definition at line 588 of file DynamicListI.H.

◆ append() [8/13]

Foam::DynamicList< T, SizeMin > & append ( DynamicList< T, SizeMin > &&  lst)
inline

Move append list.

Definition at line 615 of file DynamicListI.H.

◆ append() [9/13]

DynamicList<T, SizeMin>& append ( DynamicList< T, AnySizeMin > &&  lst)
inline

Move append list.

◆ append() [10/13]

Foam::DynamicList< T, SizeMin > & append ( SortableList< T > &&  lst)
inline

Move append list.

Definition at line 642 of file DynamicListI.H.

◆ remove() [1/4]

T remove ( )
inline

Remove and return the last element. Fatal on an empty list.

Definition at line 653 of file DynamicListI.H.

Referenced by UPstream::allocateTag(), directMethod::appendToDirectSeeds(), ifeqEntry::evaluate(), ifeqEntry::execute(), mapNearestMethod::findMappedSrcCell(), mapNearestMethod::findNearestCell(), Foam::iallReduce(), faceAreaWeightAMI::processSourceFace(), Reaction< ReactionThermo >::setLRhs(), and ifeqEntry::skipUntil().

Here is the caller graph for this function:

◆ remove() [2/4]

T remove ( const label  idx,
const bool  fast = false 
)
inline

Remove and return the specified element. Fatal on an empty list.

With fast=true (operates in constant time), the place of the removed element is swapped with the last one in the list, which changes the ordering. With fast=false (operates in linear time), the elements are swapped down in the list to preserve ordering.

Definition at line 674 of file DynamicListI.H.

◆ remove() [3/4]

Foam::label remove ( const labelRange range)
inline

Remove a (start,size) subset from the list.

The range is subsetted with the list size itself to ensure result always addresses a valid section of the list. Remaining elements are moved down.

Definition at line 697 of file DynamicListI.H.

◆ remove() [4/4]

Foam::label remove ( std::initializer_list< label >  start_size)
inline

Remove a (start,size) subset from the list.

Definition at line 707 of file DynamicListI.H.

◆ subset() [1/2]

Foam::label subset ( const labelRange range)
inline

Retain a (start,size) subset from the list.

The range is subsetted with the list size itself to ensure result always addresses a valid section of the list. Remaining elements are moved down.

Definition at line 717 of file DynamicListI.H.

◆ subset() [2/2]

Foam::label subset ( std::initializer_list< label >  start_size)
inline

Retain a (start,size) subset from List.

Definition at line 727 of file DynamicListI.H.

◆ operator()()

T & operator() ( const label  i)
inline

Return non-const access to an element, resizing list if necessary

Definition at line 739 of file DynamicListI.H.

◆ operator=() [1/12]

void operator= ( const T val)
inline

Assignment of all addressed entries to the given value.

Definition at line 754 of file DynamicListI.H.

◆ operator=() [2/12]

void operator= ( const Foam::zero  )
inline

Assignment of all entries to zero.

Definition at line 764 of file DynamicListI.H.

◆ operator=() [3/12]

void operator= ( const UList< T > &  lst)
inline

Assignment to UList.

Definition at line 774 of file DynamicListI.H.

◆ operator=() [4/12]

void operator= ( const FixedList< T, N > &  lst)
inline

Assignment to FixedList.

Definition at line 785 of file DynamicListI.H.

◆ operator=() [5/12]

void operator= ( const DynamicList< T, SizeMin > &  lst)
inline

Assignment to DynamicList.

Definition at line 802 of file DynamicListI.H.

◆ operator=() [6/12]

void operator= ( const DynamicList< T, AnySizeMin > &  lst)
inline

Assignment from DynamicList with different sizing parameters.

Definition at line 818 of file DynamicListI.H.

◆ operator=() [7/12]

void operator= ( std::initializer_list< T lst)
inline

Assignment from initializer list.

Definition at line 834 of file DynamicListI.H.

◆ operator=() [8/12]

void operator= ( const IndirectListBase< T, Addr > &  lst)
inline

Assignment from IndirectList.

Definition at line 845 of file DynamicListI.H.

◆ operator=() [9/12]

void operator= ( List< T > &&  lst)
inline

Move assignment.

Definition at line 855 of file DynamicListI.H.

◆ operator=() [10/12]

void operator= ( DynamicList< T, SizeMin > &&  lst)
inline

Move assignment.

Definition at line 866 of file DynamicListI.H.

◆ operator=() [11/12]

void operator= ( DynamicList< T, AnySizeMin > &&  lst)
inline

Move assignment.

Definition at line 883 of file DynamicListI.H.

◆ operator=() [12/12]

void operator= ( SortableList< T > &&  lst)
inline

Move assignment.

Definition at line 900 of file DynamicListI.H.

◆ append() [11/13]

Foam::DynamicList<T, SizeMin>& append ( const FixedList< T, N > &  lst)
inline

Definition at line 530 of file DynamicListI.H.

◆ append() [12/13]

Foam::DynamicList<T, SizeMin>& append ( const IndirectListBase< T, Addr > &  lst)
inline

Definition at line 568 of file DynamicListI.H.

◆ append() [13/13]

Foam::DynamicList<T, SizeMin>& append ( DynamicList< T, AnySizeMin > &&  lst)
inline

Definition at line 629 of file DynamicListI.H.

Friends And Related Function Documentation

◆ List< T >

friend class List< T >
friend

Declare friendship with the List class.

Definition at line 111 of file DynamicList.H.

◆ operator

Ostream& operator ( Ostream os,
const DynamicList< T, SizeMin > &  lst 
)
friend

◆ operator>>

Istream& operator>> ( Istream is,
DynamicList< T, SizeMin > &  lst 
)
friend

Read from Istream, discarding contents of existing DynamicList.


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