OpenFOAM logo
Open Source CFD Toolkit

DynamicList Class Template Reference

Inheritance diagram for DynamicList:

Inheritance graph
[legend]
Collaboration diagram for DynamicList:

Collaboration graph
[legend]
List of all members.

template<class T, unsigned SizeInc = 0, unsigned SizeMult = 2, unsigned SizeDiv = 1>
class Foam::DynamicList< T, SizeInc, SizeMult, SizeDiv >


Public Member Functions

 DynamicList ()
 Construct null.
 DynamicList (const label)
 Construct given size.
 DynamicList (const UList< T > &)
 Construct from UList. nextFree_ set to size().
 DynamicList (Istream &)
 Construct from Istream. nextFree_ set to size().
label size () const
 Size of the active part of the list.
void setSize (const label)
 Reset size of List.
void clear ()
 Clear the list, i.e. set next free to zero.
DynamicList< T, SizeInc, SizeMult,
SizeDiv > & 
shrink ()
 Shrink the List<T> to the number of elements used.
void append (const T &e)
 Append an element at the end of the list.
remove ()
 Return and remove the top element.
T & operator() (const label)
 Return non-const access to an element,.
void operator= (const T &)
 Assignment of all entries to the given value.

Friends

Ostreamoperator (Ostream &, const DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
Istreamoperator>> (Istream &, DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Read from Istream, discarding contents of existing DynamicList.

Constructor & Destructor Documentation

DynamicList  )  [inline]
 

Construct null.

Definition at line 36 of file DynamicListI.H.

References Foam::label.

DynamicList const   label  )  [inline, explicit]
 

Construct given size.

Definition at line 46 of file DynamicListI.H.

DynamicList const UList< T > &   )  [inline, explicit]
 

Construct from UList. nextFree_ set to size().

Definition at line 58 of file DynamicListI.H.

DynamicList Istream  )  [explicit]
 

Construct from Istream. nextFree_ set to size().


Member Function Documentation

void append const T &  e  )  [inline]
 

Append an element at the end of the list.

Definition at line 112 of file DynamicListI.H.

void clear  )  [inline]
 

Clear the list, i.e. set next free to zero.

Allocated size does not change

Reimplemented from List.

Definition at line 95 of file DynamicListI.H.

T & operator() const   label  )  [inline]
 

Return non-const access to an element,.

resizing the list if necessary

Definition at line 139 of file DynamicListI.H.

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

Here is the call graph for this function:

void operator= const T &   )  [inline]
 

Assignment of all entries to the given value.

Reimplemented from List.

Definition at line 163 of file DynamicListI.H.

T remove  )  [inline]
 

Return and remove the top element.

Definition at line 121 of file DynamicListI.H.

void setSize const   label  )  [inline]
 

Reset size of List.

Reimplemented from List.

Definition at line 79 of file DynamicListI.H.

Foam::DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink  )  [inline]
 

Shrink the List<T> to the number of elements used.

Definition at line 103 of file DynamicListI.H.

References Foam::size(), and Foam::T().

Here is the call graph for this function:

Foam::label size  )  const [inline]
 

Size of the active part of the list.

Direct over-ride of list size member function

Reimplemented from UList.

Definition at line 70 of file DynamicListI.H.

References Foam::label.

Referenced by polyTopoChange::faceBalance(), and polyTopoChange::pointBalance().


Friends And Related Function Documentation

Ostream& operator Ostream ,
const DynamicList< T, SizeInc, SizeMult, SizeDiv > & 
[friend]
 

Istream& operator>> Istream ,
DynamicList< T, SizeInc, SizeMult, SizeDiv > & 
[friend]
 

Read from Istream, discarding contents of existing DynamicList.


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