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

UPtrList< T > Class Template Reference

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

Inheritance diagram for UPtrList< T >:
Collaboration diagram for UPtrList< T >:

List of all members.


Classes

class  iterator
 An STL iterator. More...

Public Types

typedef T value_type
 Type of values the UPtrList contains.
typedef T & reference
 Type that can be used for storing into UPtrList::value_type objects.
typedef const T & const_reference
 Type that can be used for storing into constant UPtrList::value_type.

Public Member Functions

 UPtrList ()
 Null Constructor.
 UPtrList (const label)
 Construct with length specified.
 UPtrList (const Xfer< UPtrList< T > > &)
 Construct by transferring the parameter contents.
 UPtrList (UPtrList< T > &, bool reUse)
 Construct as copy or re-use as specified.
label size () const
 Return the number of elements in the UPtrList.
bool empty () const
 Return true if the UPtrList is empty (ie, size() is zero).
void setSize (const label)
 Reset size of UPtrList. This can only be used to set the size.
void resize (const label)
 Reset size of UPtrList. This can only be used to set the size.
void clear ()
 Clear the UPtrList, i.e. set size to zero.
void transfer (UPtrList< T > &)
 Transfer the contents of the argument UPtrList into this.
Xfer< UPtrList< T > > xfer ()
 Transfer contents to the Xfer container.
bool set (const label) const
 Is element set.
T * set (const label, T *)
 Set element. Return old element (can be NULL).
void reorder (const UList< label > &)
 Reorders elements. Ordering does not have to be done in.
const T & operator[] (const label) const
 Return element const reference.
T & operator[] (const label)
 Return element reference.
const T * operator() (const label) const
 Return element const pointer.
iterator begin ()
 Return an iterator to begin traversing the UPtrList.
iterator end ()
 Return an iterator to end traversing the UPtrList.

Friends

class iterator
Ostream & operator (Ostream &, const UPtrList< T > &)

Detailed Description

template<class T>
class Foam::UPtrList< T >

A 1D array 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.

Source files

Definition at line 90 of file UPtrList.H.


Member Typedef Documentation

typedef T value_type

Type of values the UPtrList contains.

Definition at line 185 of file UPtrList.H.

typedef T& reference

Type that can be used for storing into UPtrList::value_type objects.

Definition at line 188 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 194 of file UPtrList.H.


Constructor & Destructor Documentation

UPtrList (  )  [inline]

Null Constructor.

Definition at line 25 of file UPtrList.C.

UPtrList ( const label  s  )  [inline, explicit]

Construct with length specified.

Definition at line 32 of file UPtrList.C.

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

Construct by transferring the parameter contents.

Definition at line 39 of file UPtrList.C.

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

Construct as copy or re-use as specified.

Definition at line 46 of file UPtrList.C.

References UPtrList< T >::transfer().

Here is the call graph for this function:


Member Function Documentation

Foam::label size (  )  const [inline]

Return the number of elements in the UPtrList.

Definition at line 23 of file UPtrListI.H.

Referenced by searchableSurfaceCollection::findNearest().

Here is the caller graph for this function:

bool empty (  )  const [inline]

Return true if the UPtrList is empty (ie, size() is zero).

Definition at line 30 of file UPtrListI.H.

References List< T >::size().

Here is the call graph for this function:

void setSize ( const label  newSize  )  [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 55 of file UPtrList.C.

Referenced by UPtrList< T >::set().

Here is the caller graph for this function:

void resize ( const label  newSize  )  [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 37 of file UPtrListI.H.

References UList< T >::empty().

Here is the call graph for this function:

void clear (  )  [inline]

Clear the UPtrList, i.e. set size to zero.

Definition at line 81 of file UPtrList.C.

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

Transfer the contents of the argument UPtrList into this.

UPtrList and annull the argument list.

Definition at line 90 of file UPtrList.C.

References List< T >::clear().

Referenced by UPtrList< T >::UPtrList().

Here is the call graph for this function:

Here is the caller graph for this function:

Foam::Xfer< Foam::UPtrList< T > > xfer (  )  [inline]

Transfer contents to the Xfer container.

Definition at line 58 of file UPtrListI.H.

References Foam::T().

Here is the call graph for this function:

bool set ( const label  i  )  const [inline]

Is element set.

Definition at line 44 of file UPtrListI.H.

References UPtrList< T >::setSize().

Here is the call graph for this function:

T * set ( const label  i,
T *  ptr 
) [inline]

Set element. Return old element (can be NULL).

No checks on new element.

Definition at line 50 of file UPtrListI.H.

void reorder ( const UList< label > &  oldToNew  )  [inline]

Reorders elements. Ordering does not have to be done in.

ascending or descending order. Reordering has to be unique. (is shuffle)

Definition at line 97 of file UPtrList.C.

References List< T >::transfer().

Here is the call graph for this function:

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

Return element const reference.

Definition at line 67 of file UPtrListI.H.

References Foam::xferMove().

Here is the call graph for this function:

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

Return element reference.

Definition at line 81 of file UPtrListI.H.

const T * operator() ( const label  i  )  const [inline]

Return element const pointer.

Definition at line 95 of file UPtrListI.H.

Foam::UPtrList< T >::iterator begin (  )  [inline]

Return an iterator to begin traversing the UPtrList.

Definition at line 249 of file UPtrListI.H.

Foam::UPtrList< T >::iterator end (  )  [inline]

Return an iterator to end traversing the UPtrList.

Definition at line 256 of file UPtrListI.H.

References UList< T >::begin().

Here is the call graph for this function:


Friends And Related Function Documentation

friend class iterator [friend]

Definition at line 200 of file UPtrList.H.

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


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd