OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

List< T > Class Template Reference

A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bounds checking, etc. More...

Inherits UList< T >.

Inherited by cellToCellStencil, cellToFaceStencil, and faceToCellStencil.

Collaboration diagram for List< T >:

List of all members.


Public Types

typedef SubList< T > subList
 Declare type of subList.

Public Member Functions

 List ()
 Null constructor.
 List (const label)
 Construct with given size.
 List (const label, const T &)
 Construct with given size and value for all elements.
 List (const List< T > &)
 Copy constructor.
 List (const Xfer< List< T > > &)
 Construct by transferring the parameter contents.
 List (List< T > &, bool reUse)
 Construct as copy or re-use as specified.
 List (const UList< T > &, const unallocLabelList &mapAddressing)
 Construct as subset.
template<class InputIterator >
 List (InputIterator first, InputIterator last)
 Construct given start and end iterators.
template<unsigned Size>
 List (const FixedList< T, Size > &)
 Construct as copy of FixedList<T, Size>.
 List (const PtrList< T > &)
 Construct as copy of PtrList<T>.
 List (const SLList< T > &)
 Construct as copy of SLList<T>.
 List (const IndirectList< T > &)
 Construct as copy of IndirectList<T>.
 List (const UIndirectList< T > &)
 Construct as copy of UIndirectList<T>.
 List (const BiIndirectList< T > &)
 Construct as copy of BiIndirectList<T>.
 List (Istream &)
 Construct from Istream.
autoPtr< List< T > > clone () const
 Clone.
 ~List ()
label size () const
 Return the number of elements in the UList.
void resize (const label)
 Reset size of List.
void resize (const label, const T &)
 Reset size of List and value for new elements.
void setSize (const label)
 Reset size of List.
void setSize (const label, const T &)
 Reset size of List and value for new elements.
void clear ()
 Clear the list, i.e. set size to zero.
void append (const UList< T > &)
 Append a List at the end of this list.
void append (const UIndirectList< T > &)
 Append a UIndirectList at the end of this list.
void transfer (List< T > &)
 Transfer the contents of the argument List into this list.
template<unsigned SizeInc, unsigned SizeMult, unsigned SizeDiv>
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument List into this list.
void transfer (SortableList< T > &)
 Transfer the contents of the argument List into this list.
Xfer< List< T > > xfer ()
 Transfer contents to the Xfer container.
T & newElmt (const label)
 Return subscript-checked element of UList.
void operator= (const UList< T > &)
 Assignment from UList operator. Takes linear time.
void operator= (const List< T > &)
 Assignment operator. Takes linear time.
void operator= (const SLList< T > &)
 Assignment from SLList operator. Takes linear time.
void operator= (const IndirectList< T > &)
 Assignment from IndirectList operator. Takes linear time.
void operator= (const UIndirectList< T > &)
 Assignment from UIndirectList operator. Takes linear time.
void operator= (const BiIndirectList< T > &)
 Assignment from BiIndirectList operator. Takes linear time.
void operator= (const T &)
 Assignment of all entries to the given value.

Static Public Member Functions

static const List< T > & null ()
 Return a null List.

Protected Member Functions

void size (const label)
 Override size to be inconsistent with allocated storage.

Friends

Istream & operator>> (Istream &, List< T > &)
 Read List from Istream, discarding contents of existing List.

Detailed Description

template<class T>
class Foam::List< T >

A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bounds checking, etc.

Storage is allocated on free-store during construction.

Source files

Definition at line 73 of file List.H.


Member Typedef Documentation

typedef SubList<T> subList

Declare type of subList.

Definition at line 154 of file List.H.


Constructor & Destructor Documentation

List (  )  [inline]

Null constructor.

Definition at line 21 of file ListI.H.

List ( const label  s  )  [inline, explicit]

Construct with given size.

Definition at line 35 of file List.C.

References Foam::abort(), Foam::FatalError, and FatalErrorIn.

Here is the call graph for this function:

List ( const label  s,
const T &  a 
) [inline]

Construct with given size and value for all elements.

Definition at line 55 of file List.C.

References Foam::T().

Here is the call graph for this function:

List ( const List< T > &  a  )  [inline]

Copy constructor.

Definition at line 80 of file List.C.

References List_ACCESS, List_CONST_ACCESS, List_FOR_ALL, and Foam::T().

Here is the call graph for this function:

List ( const Xfer< List< T > > &  lst  )  [inline]

Construct by transferring the parameter contents.

Definition at line 108 of file List.C.

List ( List< T > &  a,
bool  reUse 
) [inline]

Construct as copy or re-use as specified.

Definition at line 116 of file List.C.

References List< T >::transfer().

Here is the call graph for this function:

List ( const UList< T > &  a,
const unallocLabelList< T > &  mapAddressing 
) [inline]

Construct as subset.

Definition at line 150 of file List.C.

References List_ACCESS, List_CONST_ACCESS, List_FOR_ALL, and Foam::T().

Here is the call graph for this function:

List ( InputIterator  first,
InputIterator  last 
) [inline]

Construct given start and end iterators.

Definition at line 170 of file List.C.

References List< T >::setSize().

Here is the call graph for this function:

List ( const FixedList< T, Size > &  lst  )  [inline]

Construct as copy of FixedList<T, Size>.

Definition at line 202 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

List ( const PtrList< T > &  lst  )  [inline]

Construct as copy of PtrList<T>.

Definition at line 220 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

List ( const SLList< T > &  lst  )  [inline]

Construct as copy of SLList<T>.

Definition at line 238 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

List ( const IndirectList< T > &  lst  )  [inline]

Construct as copy of IndirectList<T>.

Definition at line 262 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

List ( const UIndirectList< T > &  lst  )  [inline]

Construct as copy of UIndirectList<T>.

Definition at line 280 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

List ( const BiIndirectList< T > &  lst  )  [inline]

Construct as copy of BiIndirectList<T>.

Definition at line 298 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

List ( Istream &  is  )  [inline]

Construct from Istream.

Definition at line 28 of file ListIO.C.

~List (  )  [inline]

Definition at line 318 of file List.C.


Member Function Documentation

void size ( const label  n  )  [inline, protected]

Override size to be inconsistent with allocated storage.

Use with care.

Definition at line 68 of file ListI.H.

References setSize().

Referenced by Foam::bandCompression(), bufferedAccumulator< Type >::bufferLength(), cellModeller::cellModeller(), PrimitivePatch< Face, FaceList, PointField, PointType >::checkTopology(), UnsortedMeshedSurface< Face >::clear(), extendedFaceToCellStencil::collectData(), extendedCellToFaceStencil::collectData(), DimensionedField< Type, GeoMesh >::DimensionedField(), mapDistribute::distribute(), UPtrList< T >::empty(), IndirectList< T >::empty(), CompactListList< T >::empty(), BiIndirectList< T >::empty(), spray::evolve(), sampledCuttingPlane::faces(), sampledIsoSurfaceCell::faces(), sampledIsoSurface::faces(), distanceSurface::faces(), Pstream::gatherList(), boundaryMesh::getNearest(), searchablePlane::getVolumeType(), Foam::handler(), potential::idList(), lduMatrix::initMatrixInterfaces(), isoSurface::interpolate(), Foam::interpolatePointToCell(), Pstream::listCombineGather(), Iterator< TRef, TableRef >::operator++(), phasePropertiesList::operator[](), ThermoLookupTableInjection< CloudType >::parcelsToInject(), ReactingLookupTableInjection< CloudType >::parcelsToInject(), KinematicLookupTableInjection< CloudType >::parcelsToInject(), Foam::parseNASCoord(), phasePropertiesList::phasePropertiesList(), PatchToPatchInterpolation< FromPatch, ToPatch >::pointInterpolate(), PrimitivePatch< Face, FaceList, PointField, PointType >::projectFaceCentres(), PrimitivePatch< Face, FaceList, PointField, PointType >::projectPoints(), GAMGAgglomeration::restrictField(), mapDistribute::schedule(), processorLduInterface::send(), triSurfaceGeoMesh::size(), processorSurfacePatchFieldDecomposer::size(), LUscalarMatrix::solve(), PatchTools::sortedEdgeFaces(), PatchTools::subsetMap(), PrimitivePatch< Face, FaceList, PointField, PointType >::surfaceType(), Table< Type >::Table(), MeshedSurface< Face >::transcribe(), fanFvPatchField< Type >::updateCoeffs(), and ensightPart::writeField().

Here is the call graph for this function:

Foam::autoPtr< Foam::List< T > > clone (  )  const [inline]

Clone.

Reimplemented in basicSymmetryFvPatchField< Type >, calculatedFvPatchField< Type >, coupledFvPatchField< Type >, directionMixedFvPatchField< Type >, fixedGradientFvPatchField< Type >, fixedValueFvPatchField< Type >, genericFvPatchField< Type >, mixedFvPatchField< Type >, slicedFvPatchField< Type >, transformFvPatchField< Type >, zeroGradientFvPatchField< Type >, cyclicFvPatchField< Type >, emptyFvPatchField< Type >, processorFvPatchField< Type >, symmetryFvPatchField< Type >, wedgeFvPatchField< Type >, advectiveFvPatchField< Type >, directMappedFixedValueFvPatchField< Type >, expDirectionMixedFvPatchField< Type >, fanFvPatchField< Type >, fixedInternalValueFvPatchField< Type >, fixedNormalSlipFvPatchField< Type >, freestreamFvPatchField< Type >, inletOutletFvPatchField< Type >, oscillatingFixedValueFvPatchField< Type >, outletInletFvPatchField< Type >, partialSlipFvPatchField< Type >, slipFvPatchField< Type >, timeVaryingMappedFixedValueFvPatchField< Type >, timeVaryingUniformFixedValueFvPatchField< Type >, turbulentInletFvPatchField< Type >, uniformFixedValueFvPatchField< Type >, waveTransmissiveFvPatchField< Type >, fvPatchField< Type >, calculatedFvsPatchField< Type >, coupledFvsPatchField< Type >, fixedValueFvsPatchField< Type >, slicedFvsPatchField< Type >, cyclicFvsPatchField< Type >, emptyFvsPatchField< Type >, processorFvsPatchField< Type >, symmetryFvsPatchField< Type >, wedgeFvsPatchField< Type >, fvsPatchField< Type >, cellMotionFvPatchField< Type >, surfaceSlipDisplacementFvPatchField< Type >, angularOscillatingDisplacementPointPatchVectorField, angularOscillatingVelocityPointPatchVectorField, oscillatingDisplacementPointPatchVectorField, oscillatingVelocityPointPatchVectorField, PackedList< nBits >, DimensionedField< Type, GeoMesh >, DynamicField< Type >, Field< Type >, fixedValuePointPatchField< Type >, mixedPointPatchField< Type >, valuePointPatchField< Type >, timeVaryingUniformFixedValuePointPatchField< Type >, uniformFixedValuePointPatchField< Type >, epsilonWallFunctionFvPatchScalarField, kqRWallFunctionFvPatchField< Type >, omegaWallFunctionFvPatchScalarField, epsilonWallFunctionFvPatchScalarField, kqRWallFunctionFvPatchField< Type >, omegaWallFunctionFvPatchScalarField, mixedFixedValueSlipFvPatchField< Type >, phase, basicSymmetryFvPatchField< Type >, calculatedFvPatchField< Type >, coupledFvPatchField< Type >, fixedValueFvPatchField< Type >, mixedFvPatchField< Type >, transformFvPatchField< Type >, zeroGradientFvPatchField< scalar >, zeroGradientFvPatchField< Type >, cyclicFvPatchField< Type >, advectiveFvPatchField< Type >, fixedInternalValueFvPatchField< scalar >, inletOutletFvPatchField< Type >, slipFvPatchField< Type >, fvPatchField< scalar >, fvPatchField< Type >, coupledFvsPatchField< Type >, fvsPatchField< Type >, PackedList< 2 >, DimensionedField< scalar, volMesh >, DimensionedField< scalar, pointMesh >, DimensionedField< symmTensor, volMesh >, DimensionedField< vector, pointMesh >, DimensionedField< Type, GeoMesh >, DimensionedField< Type, volMesh >, DimensionedField< scalar, surfaceMesh >, DimensionedField< vector, volMesh >, DimensionedField< Type, pointMesh >, DimensionedField< Type, surfaceMesh >, DimensionedField< tensor, volMesh >, Field< tensor >, Field< scalar >, Field< label >, Field< complexVector >, Field< translationRotationVectors >, Field< Field< Type > >, Field< symmTensor >, Field< point >, Field< Type >, Field< PointType >, Field< vector >, fixedValuePointPatchField< vector >, fixedValuePointPatchField< Type >, valuePointPatchField< Type >, and valuePointPatchField< vector >.

Definition at line 26 of file ListI.H.

Foam::label size (  )  const [inline]

void transfer ( DynamicList< T, SizeInc, SizeMult, SizeDiv > &  a  )  [inline]

Transfer the contents of the argument List into this list.

and annull the argument list.

Reimplemented in DynamicList< T, SizeInc, SizeMult, SizeDiv >.

Definition at line 414 of file List.C.

void transfer ( SortableList< T > &  a  )  [inline]

Transfer the contents of the argument List into this list.

and annull the argument list.

Definition at line 426 of file List.C.

T & newElmt ( const label  i  )  [inline]

Return subscript-checked element of UList.

Definition at line 56 of file ListI.H.

References setSize().

Here is the call graph for this function:

void operator= ( const List< T > &  a  )  [inline]

Assignment operator. Takes linear time.

Reimplemented in IOList< T >, IOList< label >, and IOList< face >.

Definition at line 470 of file List.C.

References FatalErrorIn.

void operator= ( const SLList< T > &  lst  )  [inline]

Assignment from SLList operator. Takes linear time.

Definition at line 485 of file List.C.

void operator= ( const IndirectList< T > &  lst  )  [inline]

Assignment from IndirectList operator. Takes linear time.

Definition at line 513 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

void operator= ( const UIndirectList< T > &  lst  )  [inline]

Assignment from UIndirectList operator. Takes linear time.

Definition at line 532 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

void operator= ( const BiIndirectList< T > &  lst  )  [inline]

Assignment from BiIndirectList operator. Takes linear time.

Definition at line 551 of file List.C.

References UList< T >::operator[]().

Here is the call graph for this function:

void operator= ( const T &  t  )  [inline]


Friends And Related Function Documentation

Istream& operator>> ( Istream &  ,
List< T > &   
) [friend]

Read List from Istream, discarding contents of existing List.


The documentation for this class was generated from the following files:
  • src/OpenFOAM/containers/Lists/List/List.H
  • src/OpenFOAM/containers/Lists/List/List.C
  • src/OpenFOAM/containers/Lists/List/ListI.H
  • src/OpenFOAM/containers/Lists/List/ListIO.C
Copyright © 2000-2009 OpenCFD Ltd