OpenFOAM logo
Open Source CFD Toolkit

UList Class Template Reference

Inheritance diagram for UList:

Inheritance graph
[legend]
Collaboration diagram for UList:

Collaboration graph
[legend]
List of all members.

template<class T>
class Foam::UList< T >


Public Types

typedef T value_type
 Type of values the UList contains.
typedef T & reference
 Type that can be used for storing into.
typedef const T & const_reference
 Type that can be used for storing into.
typedef label difference_type
 The type that can represent the difference between any two.
typedef label size_type
 The type that can represent the size of a UList.
typedef T * iterator
 Random access iterator for traversing UList.
typedef const T * const_iterator
 Random access iterator for traversing UList.
typedef T * reverse_iterator
 Reverse iterator for reverse traversal of UList.
typedef const T * const_reverse_iterator
 Reverse iterator for reverse traversal of constant UList.

Public Member Functions

 UList ()
 Null constructor.
 UList (T *v, label size)
 Construct from components.
label fcIndex (const label i) const
 Return the forward circular index, i.e. the next index.
label rcIndex (const label i) const
 Return the reverse circular index, i.e. the previous index.
void checkStart (const label start) const
 Check start is within valid range (0 ... size-1).
void checkSize (const label size) const
 Check size is within valid range (0 ... size).
void checkIndex (const label i) const
 Check index i is within valid range (0 ... size-1).
void writeEntry (Ostream &os) const
 Write the UList as a dictionary entry.
void writeEntry (const word &keyword, Ostream &os) const
 Write the UList as a dictionary entry with keyword.
T & operator[] (const label)
 Return subscript-checked element of UList.
const T & operator[] (const label) const
 Return subscript-checked element of constant UList.
 operator const List () const
 Allow cast to a const List<T>&.
void operator= (const T &)
 Assignment of all entries to the given value.
iterator begin ()
 Return an iterator to begin traversing the UList.
iterator end ()
 Return an iterator to end traversing the UList.
const_iterator begin () const
 Return a const_iterator to begin traversing the.
const_iterator end () const
 Return a const_iterator to end traversing the.
reverse_iterator rbegin ()
 Return a reverse_iterator to begin reverse traversing the.
reverse_iterator rend ()
 Return a reverse_iterator to end reverse traversing the.
const_reverse_iterator rbegin () const
 Return a const_reverse_iterator to begin reverse traversing the.
const_reverse_iterator rend () const
 Return a const_reverse_iterator to end reverse traversing the.
label size () const
 Return the number of elements in the UList.
label max_size () const
 Return size of the largest possible UList.
bool empty () const
 Return true if the UList is empty (i.e., if size() == 0).
void swap (UList< T > &)
 Swap two ULists of the same type in constant time.
bool operator== (const UList< T > &) const
 Equality operation on ULists of the same type.
bool operator!= (const UList< T > &) const
 The opposite of the equality operation. Takes linear time.
bool operator< (const UList< T > &) const
 Compare two ULists lexicographically. Takes linear time.
bool operator> (const UList< T > &) const
 Compare two ULists lexicographically. Takes linear time.
bool operator<= (const UList< T > &) const
 Return true if !(a > b). Takes linear time.
bool operator>= (const UList< T > &) const
 Return true if !(a < b). Takes linear time.

Static Public Member Functions

UList< T > & null ()
 Return a null UList.

Friends

class List<T>
 Declare friendship with the List class.
class SubList<T>
 Declare friendship with the SubList class.
Ostreamoperator (Ostream &, const UList< T > &)

Member Typedef Documentation

typedef const T* const_iterator
 

Random access iterator for traversing UList.

Definition at line 212 of file UList.H.

Referenced by UList::begin(), UList::end(), UList::rbegin(), and UList::rend().

typedef const T& const_reference
 

Type that can be used for storing into.

constant UList::value_type objects

Definition at line 185 of file UList.H.

typedef const T* const_reverse_iterator
 

Reverse iterator for reverse traversal of constant UList.

Definition at line 248 of file UList.H.

typedef label difference_type
 

The type that can represent the difference between any two.

UList iterator objects.

Definition at line 191 of file UList.H.

typedef T* iterator
 

Random access iterator for traversing UList.

Definition at line 200 of file UList.H.

Referenced by UList::begin(), UList::end(), UList::operator const List(), and UList::rbegin().

typedef T& reference
 

Type that can be used for storing into.

UList::value_type objects.

Definition at line 179 of file UList.H.

typedef T* reverse_iterator
 

Reverse iterator for reverse traversal of UList.

Definition at line 230 of file UList.H.

typedef label size_type
 

The type that can represent the size of a UList.

Definition at line 194 of file UList.H.

typedef T value_type
 

Type of values the UList contains.

Definition at line 173 of file UList.H.


Constructor & Destructor Documentation

UList  )  [inline]
 

Null constructor.

Definition at line 51 of file UListI.H.

References Foam::label, and UList::size().

Here is the call graph for this function:

UList T *  v,
label  size
[inline]
 

Construct from components.


Member Function Documentation

UList< T >::const_iterator begin  )  const [inline]
 

Return a const_iterator to begin traversing the.

constant UList.

Definition at line 163 of file UListI.H.

References UList::iterator.

UList< T >::iterator begin  )  [inline]
 

Return an iterator to begin traversing the UList.

Definition at line 155 of file UListI.H.

References UList::const_iterator.

void checkIndex const label  i  )  const [inline]
 

Check index i is within valid range (0 ... size-1).

Definition at line 102 of file UListI.H.

void checkSize const label  size  )  const [inline]
 

Check size is within valid range (0 ... size).

Definition at line 89 of file UListI.H.

References Foam::size().

Referenced by SubList::SubList().

Here is the call graph for this function:

void checkStart const label  start  )  const [inline]
 

Check start is within valid range (0 ... size-1).

Definition at line 76 of file UListI.H.

Referenced by SubList::SubList().

bool empty  )  const [inline]
 

Return true if the UList is empty (i.e., if size() == 0).

Definition at line 231 of file UListI.H.

References Foam::Swap().

Here is the call graph for this function:

UList< T >::const_iterator end  )  const [inline]
 

Return a const_iterator to end traversing the.

constant UList.

Definition at line 179 of file UListI.H.

References UList::iterator.

UList< T >::iterator end  )  [inline]
 

Return an iterator to end traversing the UList.

Definition at line 171 of file UListI.H.

References UList::const_iterator.

label fcIndex const label  i  )  const [inline]
 

Return the forward circular index, i.e. the next index.

which returns to the first at the end of the list

Definition at line 61 of file UListI.H.

References Foam::label, and UList::size().

Referenced by face::faceEdge(), and face::nEdges().

Here is the call graph for this function:

label max_size  )  const [inline]
 

Return size of the largest possible UList.

Definition at line 224 of file UListI.H.

UList<T>& null  )  [static]
 

Return a null UList.

Reimplemented in List, SubList, Field, SubField, GeometricField, List< labelPairList >, List< pair >, List< primitivePatch * >, List< const treeLeaf< Type > * >, List< lduCoupledInterface * >, List< treeBoundBox >, List< injector * >, List< centreEdge >, List< List< T > >, List< objectHit >, List< cellZone * >, List< tensor >, List< labelList::subList * >, List< tetPolyPatchMapperCellDecomp * >, List< cellModel * >, List< procPointList >, List< Field< vector > * >, List< tetPolyPatchFaceDecomp * >, List< faceEdge >, List< fvPatch * >, List< scalar >, List< polyAddCell >, List< commsStruct >, List< token >, List< polyMeshModifier * >, List< cell >, List< T * >, List< Field< tensor > * >, List< int >, List< label >, List< vector >, List< complexVector >, List< DynamicList< label > >, List< Key >, List< unsigned int >, List< pointIndexHit >, List< cellShape >, List< lduMatrix * >, List< lduAddressingStore * >, List< faPatch * >, List< short >, List< treeLeaf< Type > * >, List< string >, List< primitivePatchInterpolation * >, List< FieldField< Field, scalar > * >, List< triFace >, List< refineCell >, List< ZoneType * >, List< pointPatch * >, List< geometricSurfacePatch >, List< chemistryReader::reactionThermo * >, List< surfAndLabel >, List< Type >, List< faceZone * >, List< entry * >, List< specieProperties * >, List< ignitionSite * >, List< pointZone * >, List< char >, List< labelledTri >, List< List< pointIndexHit > >, List< pointHitSort >, List< ThermoType * >, List< labelPair >, List< Face >, List< point2D >, List< bool >, List< Field< scalar > * >, List< tetPolyPatchMapperFaceDecomp * >, List< polyModifyPoint >, List< List< Key > >, List< point >, List< diagonalEdge >, List< pyramidEdge >, List< labelField * >, List< scalarList >, List< fvPatchMapper * >, List< surfacePatch >, List< colour >, List< polyAddPoint >, List< volScalarField * >, List< List< point2D > >, List< lduCoupledInterfacePtrsList * >, List< word >, List< chemistryReader::reaction * >, List< edge >, List< engineValve * >, List< face >, List< polyModifyCell >, List< objectMap >, List< boundaryPatch * >, List< specieCoeffs >, List< tetPolyPatchCellDecomp * >, List< polyPatch * >, List< scalarField * >, List< polyModifyFace >, List< polyAddFace >, List< labool >, List< Field< Type > * >, List< labelList >, List< vectorField >, SubList< Type >, Field< tensor >, Field< scalar >, Field< label >, Field< vector >, Field< complexVector >, Field< T >, GeometricField< vector, fvPatchField, surfaceMesh >, GeometricField< scalar, fvPatchField, surfaceMesh >, GeometricField< Type, tetPolyPatchField, tetPointMesh >, GeometricField< Type, faPatchField, areaMesh >, GeometricField< vector, PatchField, surfaceMesh >, GeometricField< vector, PatchField, volMesh >, GeometricField< vector, faPatchField, edgeMesh >, GeometricField< tensor, fvPatchField, volMesh >, GeometricField< scalar, fvPatchField, volMesh >, GeometricField< scalar, faPatchField, edgeMesh >, GeometricField< Type, faPatchField, edgeMesh >, GeometricField< vector, faPatchField, areaMesh >, GeometricField< Type, fvPatchField, surfaceMesh >, GeometricField< Type, pointPatchField, pointMesh >, GeometricField< scalar, pointPatchField, pointMesh >, GeometricField< vector, fvPatchField, volMesh >, GeometricField< vector, tetPolyPatchField, tetPointMesh >, GeometricField< scalar, tetPolyPatchField, elementMesh >, GeometricField< vector, pointPatchField, pointMesh >, GeometricField< scalar, faPatchField, areaMesh >, and GeometricField< Type, fvPatchField, volMesh >.

operator const List< T > &  )  const [inline]
 

Allow cast to a const List<T>&.

Reimplemented in SubList, and SubList< Type >.

Definition at line 145 of file UListI.H.

References UList::iterator.

bool operator!= const UList< T > &   )  const
 

The opposite of the equality operation. Takes linear time.

bool operator< const UList< T > &   )  const
 

Compare two ULists lexicographically. Takes linear time.

bool operator<= const UList< T > &   )  const
 

Return true if !(a > b). Takes linear time.

void operator= const T &   ) 
 

Assignment of all entries to the given value.

Reimplemented in DynamicList, List, Field, FixedValuePointPatchField, ValueStoredPointPatchField, fixedValueFvPatchField, mixedFvPatchField, slicedFvPatchField, directionMixedFvPatchField, expDirectionMixedFvPatchField, partialSlipFvPatchField, fvPatchField, fixedGradientFaPatchField, fixedValueFaPatchField, fixedValueOutflowFaPatchField, faPatchField, FixedValueTetPointPatchField, ValueStoredTetPointPatchField, DynamicList< procPointList >, DynamicList< polyAddCell >, DynamicList< label >, DynamicList< polyModifyPoint >, DynamicList< point >, DynamicList< polyAddPoint >, DynamicList< face >, DynamicList< word >, DynamicList< polyModifyCell >, DynamicList< polyModifyFace >, DynamicList< polyAddFace >, List< labelPairList >, List< pair >, List< primitivePatch * >, List< const treeLeaf< Type > * >, List< lduCoupledInterface * >, List< treeBoundBox >, List< injector * >, List< centreEdge >, List< List< T > >, List< objectHit >, List< cellZone * >, List< tensor >, List< labelList::subList * >, List< tetPolyPatchMapperCellDecomp * >, List< cellModel * >, List< procPointList >, List< Field< vector > * >, List< tetPolyPatchFaceDecomp * >, List< faceEdge >, List< fvPatch * >, List< scalar >, List< polyAddCell >, List< commsStruct >, List< token >, List< polyMeshModifier * >, List< cell >, List< T * >, List< Field< tensor > * >, List< int >, List< label >, List< vector >, List< complexVector >, List< DynamicList< label > >, List< Key >, List< unsigned int >, List< pointIndexHit >, List< cellShape >, List< lduMatrix * >, List< lduAddressingStore * >, List< faPatch * >, List< short >, List< treeLeaf< Type > * >, List< string >, List< primitivePatchInterpolation * >, List< FieldField< Field, scalar > * >, List< triFace >, List< refineCell >, List< ZoneType * >, List< pointPatch * >, List< geometricSurfacePatch >, List< chemistryReader::reactionThermo * >, List< surfAndLabel >, List< Type >, List< faceZone * >, List< entry * >, List< specieProperties * >, List< ignitionSite * >, List< pointZone * >, List< char >, List< labelledTri >, List< List< pointIndexHit > >, List< pointHitSort >, List< ThermoType * >, List< labelPair >, List< Face >, List< point2D >, List< bool >, List< Field< scalar > * >, List< tetPolyPatchMapperFaceDecomp * >, List< polyModifyPoint >, List< List< Key > >, List< point >, List< diagonalEdge >, List< pyramidEdge >, List< labelField * >, List< scalarList >, List< fvPatchMapper * >, List< surfacePatch >, List< colour >, List< polyAddPoint >, List< volScalarField * >, List< List< point2D > >, List< lduCoupledInterfacePtrsList * >, List< word >, List< chemistryReader::reaction * >, List< edge >, List< engineValve * >, List< face >, List< polyModifyCell >, List< objectMap >, List< boundaryPatch * >, List< specieCoeffs >, List< tetPolyPatchCellDecomp * >, List< polyPatch * >, List< scalarField * >, List< polyModifyFace >, List< polyAddFace >, List< labool >, List< Field< Type > * >, List< labelList >, List< vectorField >, Field< tensor >, Field< scalar >, Field< label >, Field< vector >, Field< complexVector >, and Field< T >.

bool operator== const UList< T > &   )  const
 

Equality operation on ULists of the same type.

Returns true when the ULists are elementwise equal (using UList::value_type::operator==). Takes linear time.

bool operator> const UList< T > &   )  const
 

Compare two ULists lexicographically. Takes linear time.

bool operator>= const UList< T > &   )  const
 

Return true if !(a < b). Takes linear time.

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

Return subscript-checked element of constant UList.

Reimplemented in speciesTable.

Definition at line 134 of file UListI.H.

T & operator[] const   label  )  [inline]
 

Return subscript-checked element of UList.

Definition at line 123 of file UListI.H.

Referenced by face::faceEdge(), face::nextLabel(), and face::points().

UList< T >::const_iterator rbegin  )  const [inline]
 

Return a const_reverse_iterator to begin reverse traversing the.

UList.

Definition at line 194 of file UListI.H.

References UList::iterator.

UList< T >::iterator rbegin  )  [inline]
 

Return a reverse_iterator to begin reverse traversing the.

UList.

Definition at line 186 of file UListI.H.

References UList::const_iterator.

label rcIndex const label  i  )  const [inline]
 

Return the reverse circular index, i.e. the previous index.

which returns to the last at the begining of the list

Definition at line 68 of file UListI.H.

References FatalErrorIn.

Referenced by face::nextLabel().

UList< T >::const_iterator rend  )  const [inline]
 

Return a const_reverse_iterator to end reverse traversing the.

UList.

Definition at line 210 of file UListI.H.

References Foam::label.

UList< T >::iterator rend  )  [inline]
 

Return a reverse_iterator to end reverse traversing the.

UList.

Definition at line 202 of file UListI.H.

References UList::const_iterator.

label size  )  const [inline]
 

Return the number of elements in the UList.

Reimplemented in DynamicList, PackedList, ValueStoredPointPatchField, emptyFaPatch, faPatch, ValueStoredTetPointPatchField, DynamicList< procPointList >, DynamicList< polyAddCell >, DynamicList< label >, DynamicList< polyModifyPoint >, DynamicList< point >, DynamicList< polyAddPoint >, DynamicList< face >, DynamicList< word >, DynamicList< polyModifyCell >, DynamicList< polyModifyFace >, DynamicList< polyAddFace >, and PackedList< 1 >.

Definition at line 217 of file UListI.H.

References Foam::label.

Referenced by List::clone(), cellShape::collapsedFaces(), structuredScalars2D::DataRow(), face::face(), UList::fcIndex(), IndirectList::IndirectList(), octreeDataFace::mesh(), meshEdgeCuts::meshEdges(), cellModel::modelFaces(), cellModel::nFaces(), primitiveMesh::nPoints(), StaticHashTable::Iterator::operator()(), IndirectList::operator[](), and UList::UList().

void swap UList< T > &   ) 
 

Swap two ULists of the same type in constant time.

void writeEntry const word keyword,
Ostream os
const
 

Write the UList as a dictionary entry with keyword.

Reimplemented in Field, Field< tensor >, Field< scalar >, Field< label >, Field< vector >, Field< complexVector >, and Field< T >.

void writeEntry Ostream os  )  const
 

Write the UList as a dictionary entry.


Friends And Related Function Documentation

friend class List<T> [friend]
 

Declare friendship with the List class.

Definition at line 100 of file UList.H.

Ostream& operator Ostream ,
const UList< T > & 
[friend]
 

friend class SubList<T> [friend]
 

Declare friendship with the SubList class.

Definition at line 103 of file UList.H.


The documentation for this class was generated from the following files:
For further information go to www.openfoam.org