PackedList< nBits >::iterator Class Reference

The iterator class used for PackedList. More...

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

Public Member Functions

 iterator ()
 Construct null. More...
 
 iterator (const iteratorBase &)
 Construct from iterator base, eg iter(packedlist[i]) More...
 
 iterator (const PackedList *, const label)
 Construct from base list and position index. More...
 
bool operator== (const iteratorBase &) const
 Compare positions (not values) More...
 
bool operator!= (const iteratorBase &) const
 
void operator= (const iteratorBase &)
 Assign from iteratorBase, eg iter = packedlist[i]. More...
 
unsigned int operator* () const
 Return value. More...
 
unsigned int operator() () const
 Return value. More...
 
iteratorBaseoperator* ()
 Return iteratorBase for assigning values. More...
 
iteratorBaseoperator() ()
 Return iteratorBase for assigning values. More...
 
iteratoroperator++ ()
 
iterator operator++ (int)
 
iteratoroperator-- ()
 
iterator operator-- (int)
 
- Public Member Functions inherited from PackedList< nBits >::iteratorBase
 iteratorBase (const iteratorBase &)=default
 Default copy constructor. More...
 
label key () const
 Return the element index corresponding to the iterator. More...
 
bool writeIfSet (Ostream &) const
 Write index/value for a non-zero entry. More...
 
bool operator== (const iteratorBase &) const
 Compare values (not positions) More...
 
bool operator!= (const iteratorBase &) const
 
void operator= (const iteratorBase &)
 Assign value, not position. More...
 
void operator= (const unsigned int val)
 Assign value. More...
 
 operator unsigned int () const
 Conversion operator. More...
 
OstreamprintInfo (Ostream &) const
 Print information and values. More...
 
template<>
bool writeIfSet (Ostream &os) const
 

Additional Inherited Members

- Protected Member Functions inherited from PackedList< nBits >::iteratorBase
unsigned int get () const
 Get value as unsigned, no range-checking. More...
 
bool set (unsigned int)
 Set value, returning true if changed, no range-checking. More...
 
 iteratorBase ()
 Construct null. More...
 
 iteratorBase (const PackedList *, const label)
 Construct from base list and position index. More...
 
- Protected Attributes inherited from PackedList< nBits >::iteratorBase
PackedListlist_
 Pointer to original list. More...
 
label index_
 Element index. More...
 

Detailed Description

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

The iterator class used for PackedList.

Definition at line 492 of file PackedList.H.

Constructor & Destructor Documentation

◆ iterator() [1/3]

iterator ( )
inline

Construct null.

Definition at line 397 of file PackedListI.H.

Referenced by PackedList< nBits >::const_iterator::const_iterator().

Here is the caller graph for this function:

◆ iterator() [2/3]

iterator ( const iteratorBase iter)
inline

Construct from iterator base, eg iter(packedlist[i])

but also "iterator iter = packedlist[i];" An out-of-range iterator is assigned end()

Definition at line 412 of file PackedListI.H.

References PackedList< nBits >::const_iterator::const_iterator(), PackedList< nBits >::iteratorBase::index_, and PackedList< nBits >::iteratorBase::list_.

Here is the call graph for this function:

◆ iterator() [3/3]

iterator ( const PackedList ,
const label   
)
inline

Construct from base list and position index.

Member Function Documentation

◆ operator==()

bool operator== ( const iteratorBase iter) const
inline

Compare positions (not values)

Definition at line 478 of file PackedListI.H.

References PackedList< nBits >::iteratorBase::index_.

◆ operator!=()

bool operator!= ( const iteratorBase iter) const
inline

Definition at line 488 of file PackedListI.H.

References PackedList< nBits >::iteratorBase::index_.

◆ operator=()

void operator= ( const iteratorBase iter)
inline

Assign from iteratorBase, eg iter = packedlist[i].

An out-of-range iterator is assigned end()

Definition at line 518 of file PackedListI.H.

References PackedList< nBits >::iteratorBase::index_, and PackedList< nBits >::iteratorBase::list_.

◆ operator*() [1/2]

unsigned int operator* ( ) const
inline

Return value.

◆ operator()() [1/2]

unsigned int operator() ( ) const
inline

Return value.

◆ operator*() [2/2]

Foam::PackedList< nBits >::iteratorBase & operator* ( )
inline

Return iteratorBase for assigning values.

Definition at line 630 of file PackedListI.H.

◆ operator()() [2/2]

Foam::PackedList< nBits >::iteratorBase & operator() ( )
inline

Return iteratorBase for assigning values.

Definition at line 638 of file PackedListI.H.

◆ operator++() [1/2]

Foam::PackedList< nBits >::iterator & operator++ ( )
inline

Definition at line 554 of file PackedListI.H.

References PackedList< nBits >::iteratorBase::index_.

◆ operator++() [2/2]

Foam::PackedList< nBits >::iterator operator++ ( int  )
inline

Definition at line 572 of file PackedListI.H.

References PackedList< nBits >::iteratorBase::index_.

◆ operator--() [1/2]

Foam::PackedList< nBits >::iterator & operator-- ( )
inline

Definition at line 592 of file PackedListI.H.

References PackedList< nBits >::iteratorBase::index_.

◆ operator--() [2/2]

Foam::PackedList< nBits >::iterator operator-- ( int  )
inline

Definition at line 610 of file PackedListI.H.

References PackedList< nBits >::iteratorBase::index_.


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