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

DynamicList Class Template Reference

Inheritance diagram for DynamicList:

Inheritance graph
[legend]
Collaboration diagram for DynamicList:

Collaboration graph
[legend]
List of all members.

Detailed Description

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

Definition at line 83 of file DynamicList.H.


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 setSize (const label, const T &)
 Reset size of List and value for new elements.
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 transfer (List< T > &)
 Transfer the contents of the argument List into this List.
void transfer (DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
 Transfer the contents of the argument DynamicList into this.
void append (const T &e)
 Append an element at the end of the list.
T 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.
void operator= (const List< T > &)
 Assignment to List<T>.

Friends

Ostream & operator (Ostream &, const DynamicList< T, SizeInc, SizeMult, SizeDiv > &)
Istream & operator>> (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.

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

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.

void setSize ( const   label  )  [inline]

Reset size of List.

Reimplemented from List.

Definition at line 79 of file DynamicListI.H.

void setSize ( const   label,
const T &   
) [inline]

Reset size of List and value for new elements.

Reimplemented from List.

Definition at line 96 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 114 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 122 of file DynamicListI.H.

References FatalErrorIn, and UList::size().

Here is the call graph for this function:

void transfer ( List< T > &   )  [inline]

Transfer the contents of the argument List into this List.

and annull the argument list. Is same as List::transfer except checks that you're not changing the underlying list to something smaller than nextFree_.

Reimplemented from List.

Definition at line 131 of file DynamicListI.H.

void transfer ( DynamicList< T, SizeInc, SizeMult, SizeDiv > &   )  [inline]

Transfer the contents of the argument DynamicList into this.

DynamicList and annull the argument list.

Definition at line 154 of file DynamicListI.H.

void append ( const T &  e  )  [inline]

Append an element at the end of the list.

Definition at line 166 of file DynamicListI.H.

T remove (  )  [inline]

Return and remove the top element.

Definition at line 175 of file DynamicListI.H.

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

Return non-const access to an element,.

resizing the list if necessary

Definition at line 193 of file DynamicListI.H.

References Foam::max().

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 217 of file DynamicListI.H.

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

Assignment to List<T>.

Reimplemented from List.

Definition at line 228 of file DynamicListI.H.


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: Copyright © 2000-2007 OpenCFD Ltd