OpenFOAM logo
Open Source CFD Toolkit

PtrList Class Template Reference

Inheritance diagram for PtrList:

Inheritance graph
[legend]
Collaboration diagram for PtrList:

Collaboration graph
[legend]
List of all members.

template<class T>
class Foam::PtrList< T >


Public Types

typedef T * Tptr
 Return an element pointer to be set. The pointer is checked.
typedef T value_type
 Type of values the PtrList contains.
typedef T & reference
 Type that can be used for storing into PtrList::value_type objects.
typedef const T & const_reference
 Type that can be used for storing into constant PtrList::value_type.

Public Member Functions

 PtrList ()
 Null Constructor.
 PtrList (const label)
 Construct with length specified.
 PtrList (const PtrList< T > &)
 Copy constructor.
template<class CloneArg>
 PtrList (const PtrList< T > &, const CloneArg &)
 Copy constructor with additional argument for clone.
 PtrList (PtrList< T > &, bool reUse)
 Construct as copy or re-use as specified.
 PtrList (const SLPtrList< T > &)
 Construct as copy of SLPtrList<T>.
template<class INew>
 PtrList (Istream &, const INew &)
 Construct from Istream using given Istream constructor class.
 PtrList (Istream &)
 Construct from Istream using default Istream constructor class.
 ~PtrList ()
label size () const
 Return the number of elements in the PtrList.
void setSize (const label)
 Reset size of PtrList. This can only be used to set the size of.
void clear ()
 Clear the PtrList, i.e. set size to zero deleting all the.
void transfer (PtrList< T > &)
 Transfer the contents of the argument PtrList into this PtrList.
Tptrset (const label)
void hook (T *)
 Hook an an element created by new onto the list.
void hook (const autoPtr< T > &)
 Hook an an element created by new onto the list.
void hook (const tmp< T > &)
 Hook an an element created by new onto the list.
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.
PtrList< T > & operator= (const PtrList< T > &)
 Assignment.
iterator begin ()
 Return an iterator to begin traversing the PtrList.
iterator end ()
 Return an iterator to end traversing the PtrList.

Protected Member Functions

label nextFree () const
 Return address of next free element.

Friends

class iterator
Istreamoperator>> (Istream &, PtrList< T > &)
 Read List from Istream, discarding contents of existing List.
Ostreamoperator (Ostream &, const PtrList< T > &)

Member Typedef Documentation

typedef const T& const_reference
 

Type that can be used for storing into constant PtrList::value_type.

objects.

Definition at line 257 of file PtrList.H.

typedef T& reference
 

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

Definition at line 251 of file PtrList.H.

typedef T* Tptr
 

Return an element pointer to be set. The pointer is checked.

if already set and the index range checked.

Definition at line 209 of file PtrList.H.

typedef T value_type
 

Type of values the PtrList contains.

Definition at line 248 of file PtrList.H.


Constructor & Destructor Documentation

PtrList  ) 
 

Null Constructor.

PtrList const   label  )  [explicit]
 

Construct with length specified.

PtrList const PtrList< T > &   ) 
 

Copy constructor.

PtrList const PtrList< T > &  ,
const CloneArg & 
 

Copy constructor with additional argument for clone.

PtrList PtrList< T > &  ,
bool  reUse
 

Construct as copy or re-use as specified.

PtrList const SLPtrList< T > &   ) 
 

Construct as copy of SLPtrList<T>.

PtrList Istream ,
const INew
 

Construct from Istream using given Istream constructor class.

PtrList Istream  ) 
 

Construct from Istream using default Istream constructor class.

~PtrList  ) 
 


Member Function Documentation

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

Return an iterator to begin traversing the PtrList.

Definition at line 263 of file PtrListI.H.

void clear  ) 
 

Clear the PtrList, i.e. set size to zero deleting all the.

allocated entries.

Reimplemented in ZoneMesh, ZoneMesh< pointZone >, ZoneMesh< cellZone >, and ZoneMesh< faceZone >.

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

Return an iterator to end traversing the PtrList.

Definition at line 269 of file PtrListI.H.

void hook const tmp< T > &   )  [inline]
 

Hook an an element created by new onto the list.

Definition at line 69 of file PtrListI.H.

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

Here is the call graph for this function:

void hook const autoPtr< T > &   )  [inline]
 

Hook an an element created by new onto the list.

Definition at line 62 of file PtrListI.H.

References PtrList::hook().

Here is the call graph for this function:

void hook T *   ) 
 

Hook an an element created by new onto the list.

Referenced by PtrList::hook(), and PtrList::size().

label nextFree  )  const [inline, protected]
 

Return address of next free element.

Definition at line 133 of file PtrList.H.

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

Return element const pointer.

Definition at line 110 of file PtrListI.H.

PtrList<T>& operator= const PtrList< T > &   ) 
 

Assignment.

T & operator[] const   label  )  [inline]
 

Return element reference.

Definition at line 96 of file PtrListI.H.

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

Return element const reference.

Definition at line 80 of file PtrListI.H.

void reorder const UList< label > &   ) 
 

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

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

Tptr& set const   label  ) 
 

void setSize const   label  ) 
 

Reset size of PtrList. This can only be used to set the size of.

an empty PtrList, extend a PtrList, remove entries from the end of a PtrList. If the entries are non-empty they are deleted.

label size  )  const [inline]
 

Return the number of elements in the PtrList.

Definition at line 55 of file PtrListI.H.

References PtrList::hook().

Here is the call graph for this function:

void transfer PtrList< T > &   ) 
 

Transfer the contents of the argument PtrList into this PtrList.

and annull the argument list.


Friends And Related Function Documentation

friend class iterator [friend]
 

Definition at line 264 of file PtrList.H.

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

Istream& operator>> Istream ,
PtrList< T > & 
[friend]
 

Read List from Istream, discarding contents of existing List.


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