FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

PackedList< nBits >::iteratorBase Class Reference

The iterator base for PackedList. More...

#include <src/OpenFOAM/containers/Lists/PackedList/PackedList.H>


Detailed Description

template<unsigned nBits = 1>
class Foam::PackedList< nBits >::iteratorBase

The iterator base for PackedList.

Note: data and functions are protected, to allow reuse by iterator and prevent most external usage.

Definition at line 304 of file PackedList.H.

Inheritance diagram for PackedList< nBits >::iteratorBase:
Collaboration diagram for PackedList< nBits >::iteratorBase:

List of all members.

Public Member Functions

bool  operator== (const iteratorBase &) const
 Compare values (not positions)
bool  operator!= (const iteratorBase &) const
unsigned int  operator= (const iteratorBase &)
 Assign value, not position.
unsigned int  operator= (const unsigned int val)
 Assign value.
 operator unsigned int () const
 Conversion operator.
Ostream &  print (Ostream &) const
 Print value and information.

Protected Member Functions

unsigned int  get () const
 Get value as unsigned, no range-checking.
bool  set (unsigned int)
 Set value, returning true if changed, no range-checking.
 iteratorBase ()
 Construct null.
 iteratorBase (const PackedList *, const label)
 Construct from base list and position index.

Protected Attributes

PackedList *  list_
 Pointer to original list.
label  index_
 Element index.

Friends

class  PackedList

Constructor & Destructor Documentation

iteratorBase (  ) [inline, protected]

Construct null.

Definition at line 116 of file PackedListI.H.

iteratorBase ( const PackedList *   ,
const   label  
) [inline, protected]

Construct from base list and position index.


Member Function Documentation

unsigned int get (  ) const [inline, protected]
bool set ( unsigned int   val  ) [inline, protected]

Set value, returning true if changed, no range-checking.

Definition at line 149 of file PackedListI.H.

References PackedList< nBits >::max_value(), and PackedList< nBits >::packing().

Referenced by PackedList< nBits >::append(), PackedList< nBits >::set(), and PackedList< nBits >::unset().

bool operator== ( const iteratorBase &   iter  ) const [inline]

Compare values (not positions)

Reimplemented in PackedList< nBits >::iterator, and PackedList< nBits >::const_iterator.

Definition at line 177 of file PackedListI.H.

References PackedList< nBits >::get().

bool operator!= ( const iteratorBase &   iter  ) const [inline]

Reimplemented in PackedList< nBits >::iterator, and PackedList< nBits >::const_iterator.

Definition at line 187 of file PackedListI.H.

unsigned int operator= ( const iteratorBase &   iter  ) [inline]

Assign value, not position.

This allows packed[0] = packed[3] for assigning values

Reimplemented in PackedList< nBits >::iterator, and PackedList< nBits >::const_iterator.

Definition at line 197 of file PackedListI.H.

References PackedList< nBits >::iteratorBase::get().

unsigned int operator= ( const unsigned int   val  ) [inline]

Assign value.

A non-existent entry will be auto-vivified.

Definition at line 207 of file PackedListI.H.

operator unsigned int (  ) const [inline]

Conversion operator.

Never auto-vivify entries.

Definition at line 222 of file PackedListI.H.

Foam::Ostream & print ( Ostream &   os  ) const

Print value and information.

Definition at line 190 of file PackedList.C.

References Foam::nl.


Friends And Related Function Documentation

friend class PackedList [friend]

Definition at line 306 of file PackedList.H.


Member Data Documentation

PackedList* list_ [protected]

Pointer to original list.

This also lets us use the default bitwise copy/assignment

Definition at line 314 of file PackedList.H.

Referenced by PackedList< nBits >::const_iterator::operator=(), and PackedList< nBits >::iterator::operator=().


The documentation for this class was generated from the following files: