OpenFOAM logo
The Open Source CFD Toolbox
  Programmer’s C++ Doxygen OpenCFD Solutions Contact OpenFOAM

UList Class Template Reference

Inheritance diagram for UList:

Inheritance graph
[legend]
Collaboration diagram for UList:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Definition at line 80 of file UList.H.


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 *__restrict__ 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.
label byteSize () const
 Return the binary size in number of characters of the UList.
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.
void assign (const UList< T > &)
 Assign elements to those from UList.
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

static 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.
Ostream & operator (Ostream &, const UList< T > &)

Member Typedef Documentation

typedef T value_type

Type of values the UList contains.

Definition at line 179 of file UList.H.

typedef T& reference

Type that can be used for storing into.

UList::value_type objects.

Definition at line 185 of file UList.H.

typedef const T& const_reference

Type that can be used for storing into.

constant UList::value_type objects

Definition at line 191 of file UList.H.

The type that can represent the difference between any two.

UList iterator objects.

Definition at line 197 of file UList.H.

typedef label size_type

The type that can represent the size of a UList.

Definition at line 200 of file UList.H.

typedef T* iterator

Random access iterator for traversing UList.

Definition at line 206 of file UList.H.

typedef const T* const_iterator

Random access iterator for traversing UList.

Definition at line 218 of file UList.H.

typedef T* reverse_iterator

Reverse iterator for reverse traversal of UList.

Definition at line 236 of file UList.H.

typedef const T* const_reverse_iterator

Reverse iterator for reverse traversal of constant UList.

Definition at line 254 of file UList.H.


Constructor & Destructor Documentation

UList (  )  [inline]

Null constructor.

Definition at line 43 of file UListI.H.

UList ( T *__restrict__  v,
label  size 
) [inline]

Construct from components.

Definition at line 51 of file UListI.H.

References UList::size().

Here is the call graph for this function:


Member Function Documentation

static UList<T>& null (  )  [static]

Return a null UList.

Reimplemented in List, SubList, DimensionedField, SubDimensionedField, Field, SubField, GeometricField, List< Foam::centreEdge >, List< const Foam::PrimitivePatchInterpolationrimitivePatchInterpolation< Foam::PrimitivePatch< Foam::face, Foam::SubList, Foam::Field & > > * >, List< Foam::GeometricFieldeometricField< scalar, Foam::fvPatchField, Foam::volMesh > * >, List< Foam::Field< Type > * >, List< Foam::engineValve * >, List< long >, List< Foam::lduMatrix * >, List< Foam::Fieldield< scalar > * >, List< Foam::Fieldield< long > * >, List< Foam::objectMap >, List< Foam::Pstream::commsStruct >, List< Foam::coordinateSystem * >, List< node >, List< Foam::treeLeaf< Type > * >, List< Foam::word >, List< Foam::token >, List< Foam::Field< Type >< scalar > * >, List< scalar >, List< Foam::Field< Type >< TransferType::dataType > * >, List< Foam::triSurfaceMesh * >, List< Foam::Field< Type >< Type > * >, List< T * >, List< Foam::boundaryPatch * >, List< int >, List< Foam::pointIndexHit >, List< Foam::sutherlandTransportutherlandTransport< Foam::specieThermo< Foam::janafThermo< Foam::perfectGas > > > * >, List< Foam::refinementHistory::splitCell8 >, List< Key >, List< Foam::Listist< long > * >, List< Foam::point2D >, List< const Foam::treeLeaf< Type > * >, List< unsigned int >, List< Foam::Reaction::specieCoeffs >, List< Foam::VectorSpaceectorSpace< Vector< scalar >, scalar, 2 > >, List< Foam::fvPatch * >, List< Foam::entry * >, List< Foam::Vectorector< scalar > >, List< short >, List< Foam::cellModel * >, List< Foam::Listist< labelPair > >, List< Foam::surfacePatch >, List< Foam::labelledTri >, List< ZoneType * >, List< Foam::List< Foam::pointIndexHit > >, List< Foam::polyMeshModifier * >, List< Type >, List< Foam::Field< TransferType::dataType > * >, List< Foam::List< Key > >, List< Foam::Listist< face > >, List< Foam::fvPatchMapper * >, List< Foam::Pairair< label > >, List< Foam::pointHitSort >, List< TransferType::dataType >, List< Foam::injector * >, List< Foam::FixedList< long, 3 > >, List< Foam::Listist< procPoint > >, List< Foam::objectHit >, List< const Foam::PrimitivePatchrimitivePatch< Foam::face, Foam::SubList, Foam::Field & > * >, List< char >, List< Foam::Reactioneaction< Foam::sutherlandTransportutherlandTransport< specieThermo< janafThermo< perfectGas > > > > * >, List< Foam::pointPatch * >, List< bool >, List< ThermoType * >, List< Foam::List< T > >, List< Face >, List< Foam::colour >, List< Foam::sutherlandTransport< thermo > * >, List< Foam::Reaction< ReactionThermo > * >, List< Foam::indexedOctree< Foam::treeDataTriSurface > * >, List< Foam::DynamicList< long > >, List< Foam::lduPrimitiveMesh * >, List< Foam::pyramidEdge >, List< Foam::surfAndLabel >, List< Foam::porousZone * >, List< Foam::Fieldield< vector > >, List< Foam::FieldField< Foam::Field< Type >, scalar > * >, List< Foam::faceEdge >, List< Foam::ignitionSite * >, List< const Foam::UPtrListPtrList< Foam::lduInterface > * >, List< Foam::MRFZone * >, List< PatchField< Type > * >, List< Foam::refineCell >, List< Foam::sutherlandTransportutherlandTransport< Foam::Foam::specieThermo< Foam::Foam::janafThermo< Foam::Foam::perfectGas > > > * >, List< const Foam::UPtrListPtrList< Foam::lduInterfaceField > * >, List< Foam::diagonalEdge >, List< Foam::liquid * >, List< Foam::face >, List< Foam::polyPatch * >, List< Foam::Listist< label > >, List< Foam::FixedList< scalar, 3 > >, List< Foam::Vector< Cmpt > >, List< Foam::procLduInterface * >, List< const Foam::UListList< label > * >, List< Foam::List< Foam::point2D > >, List< Foam::triFace >, SubList< Type >, SubList< Foam::face >, DimensionedField< scalar, Foam::volMesh >, DimensionedField< scalar, Foam::pointMesh >, DimensionedField< Type, Foam::GeoMesh< MESH > >, DimensionedField< Type, Foam::surfaceMesh >, DimensionedField< Type, Foam::volMesh >, DimensionedField< Foam::Vectorector< scalar >, Foam::volMesh >, DimensionedField< Type >, DimensionedField< Foam::Vectorector< scalar >, Foam::pointMesh >, DimensionedField< TransferType::dataType, Foam::volMesh >, DimensionedField< Type, Foam::pointMesh >, Field< scalar >, Field< T >, Field< Foam::Vectorector< scalar > >, Field< TransferType::dataType >, GeometricField< Type, Foam::fvsPatchField< Type >, Foam::surfaceMesh >, GeometricField< Foam::Vectorector< scalar >, Foam::pointPatchField< Type >, Foam::pointMesh >, GeometricField< TransferType::dataType, Foam::fvPatchField< Type >, Foam::volMesh >, GeometricField< Type, PatchField, Foam::GeoMesh< MESH > >, GeometricField< scalar, Foam::pointPatchField< Type >, Foam::pointMesh >, GeometricField< Type, Foam::pointPatchField< Type >, Foam::pointMesh >, GeometricField< Foam::Vectorector< scalar >, Foam::fvPatchField< Type >, Foam::volMesh >, GeometricField< Type, Foam::fvPatchField< Type >, Foam::volMesh >, and GeometricField< scalar, Foam::fvPatchField< Type >, Foam::volMesh >.

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 UList::size().

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

Here is the call graph for this function:

Here is the caller graph for this function:

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

Here is the caller graph for this function:

label byteSize (  )  const

Return the binary size in number of characters of the UList.

if the element is a primitive type i.e. contiguous<T>() == true

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

Here is the caller graph for this function:

void checkSize ( const label  size  )  const [inline]

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

Definition at line 89 of file UListI.H.

Referenced by SubList::SubList().

Here is the caller graph for this function:

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

Reimplemented in Field, Field< scalar >, Field< T >, Field< Foam::Vectorector< scalar > >, and Field< TransferType::dataType >.

void assign ( const UList< T > &   ) 

Assign elements to those from UList.

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

Return subscript-checked element of UList.

Reimplemented in PackedList, PackedList< 1 >, and PackedList< 2 >.

Definition at line 123 of file UListI.H.

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

Here is the caller graph for this function:

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

Return subscript-checked element of constant UList.

Reimplemented in PackedList, speciesTable, PackedList< 1 >, and PackedList< 2 >.

Definition at line 134 of file UListI.H.

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

Allow cast to a const List<T>&.

Reimplemented in SubList, SubList< Type >, and SubList< Foam::face >.

Definition at line 145 of file UListI.H.

void operator= ( const T &   ) 

Assignment of all entries to the given value.

Reimplemented in DynamicList, List, Field, fixedValuePointPatchField, valuePointPatchField, directionMixedFvPatchField, fixedValueFvPatchField, mixedFvPatchField, slicedFvPatchField, expDirectionMixedFvPatchField, fixedNormalSlipFvPatchField, partialSlipFvPatchField, fvPatchField, fixedValueFvsPatchField, slicedFvsPatchField, fvsPatchField, DynamicList< long >, DynamicList< Foam::word >, DynamicList< Foam::refinementHistory::splitCell8 >, DynamicList< Foam::Listist< procPoint > >, DynamicList< Foam::face >, List< Foam::centreEdge >, List< Foam::Field< Type > * >, List< Foam::engineValve * >, List< long >, List< Foam::lduMatrix * >, List< Foam::Fieldield< scalar > * >, List< Foam::Fieldield< long > * >, List< Foam::objectMap >, List< Foam::Pstream::commsStruct >, List< Foam::coordinateSystem * >, List< node >, List< Foam::treeLeaf< Type > * >, List< Foam::word >, List< Foam::token >, List< Foam::Field< Type >< scalar > * >, List< scalar >, List< Foam::Field< Type >< TransferType::dataType > * >, List< Foam::triSurfaceMesh * >, List< Foam::Field< Type >< Type > * >, List< T * >, List< Foam::boundaryPatch * >, List< int >, List< Foam::pointIndexHit >, List< Foam::refinementHistory::splitCell8 >, List< Key >, List< Foam::Listist< long > * >, List< Foam::point2D >, List< const Foam::treeLeaf< Type > * >, List< unsigned int >, List< Foam::Reaction::specieCoeffs >, List< Foam::fvPatch * >, List< Foam::entry * >, List< Foam::Vectorector< scalar > >, List< short >, List< Foam::cellModel * >, List< Foam::surfacePatch >, List< Foam::labelledTri >, List< ZoneType * >, List< Foam::List< Foam::pointIndexHit > >, List< Foam::polyMeshModifier * >, List< Type >, List< Foam::Field< TransferType::dataType > * >, List< Foam::List< Key > >, List< Foam::fvPatchMapper * >, List< Foam::pointHitSort >, List< TransferType::dataType >, List< Foam::injector * >, List< Foam::FixedList< long, 3 > >, List< Foam::Listist< procPoint > >, List< Foam::objectHit >, List< char >, List< Foam::pointPatch * >, List< bool >, List< ThermoType * >, List< Foam::List< T > >, List< Face >, List< Foam::colour >, List< Foam::sutherlandTransport< thermo > * >, List< Foam::Reaction< ReactionThermo > * >, List< Foam::indexedOctree< Foam::treeDataTriSurface > * >, List< Foam::DynamicList< long > >, List< Foam::lduPrimitiveMesh * >, List< Foam::pyramidEdge >, List< Foam::surfAndLabel >, List< Foam::porousZone * >, List< Foam::FieldField< Foam::Field< Type >, scalar > * >, List< Foam::faceEdge >, List< Foam::ignitionSite * >, List< Foam::MRFZone * >, List< PatchField< Type > * >, List< Foam::refineCell >, List< Foam::sutherlandTransportutherlandTransport< Foam::Foam::specieThermo< Foam::Foam::janafThermo< Foam::Foam::perfectGas > > > * >, List< Foam::diagonalEdge >, List< Foam::liquid * >, List< Foam::face >, List< Foam::polyPatch * >, List< Foam::FixedList< scalar, 3 > >, List< Foam::Vector< Cmpt > >, List< Foam::procLduInterface * >, List< Foam::List< Foam::point2D > >, List< Foam::triFace >, Field< scalar >, Field< T >, Field< Foam::Vectorector< scalar > >, Field< TransferType::dataType >, fixedValuePointPatchField< Foam::Vectorector< scalar > >, and valuePointPatchField< Foam::Vectorector< scalar > >.

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

Return an iterator to begin traversing the UList.

Definition at line 155 of file UListI.H.

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

Return an iterator to end traversing the UList.

Definition at line 171 of file UListI.H.

Referenced by UPtrList::begin(), and PtrList::begin().

Here is the caller graph for this function:

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.

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.

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

Return a reverse_iterator to begin reverse traversing the.

UList.

Definition at line 186 of file UListI.H.

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

Return a reverse_iterator to end reverse traversing the.

UList.

Definition at line 202 of file UListI.H.

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.

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.

label max_size (  )  const [inline]

Return size of the largest possible UList.

Definition at line 224 of file UListI.H.

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:

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.

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

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.


Friends And Related Function Documentation

friend class List< T > [friend]

Declare friendship with the List class.

Definition at line 96 of file UList.H.

friend class SubList< T > [friend]

Declare friendship with the SubList class.

Definition at line 99 of file UList.H.

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

Referenced by speciesTable::contains().


The documentation for this class was generated from the following files:
  • src/OpenFOAM/containers/Lists/UList/UList.H
  • src/OpenFOAM/containers/Lists/UList/UListI.H
Copyright © 2000-2007 OpenCFD Ltd