The iterator base for PackedList. More...


Public Member Functions | |
| 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... | |
| Ostream & | printInfo (Ostream &) const |
| Print information and values. More... | |
| template<> | |
| bool | writeIfSet (Ostream &os) const |
Protected Member Functions | |
| 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 | |
| PackedList * | list_ |
| Pointer to original list. More... | |
| label | index_ |
| Element index. More... | |
Friends | |
| class | PackedList |
The iterator base for PackedList.
Note: data and functions are protected, to allow reuse by iterator and prevent most external usage.
Definition at line 421 of file PackedList.H.
|
inlineprotected |
Construct null.
Definition at line 269 of file PackedListI.H.
References PackedList< nBits >::iteratorBase::index_, and PackedList< nBits >::iteratorBase::list_.
Referenced by PackedList< nBits >::append(), PackedList< nBits >::const_iterator::const_iterator(), PackedList< nBits >::get(), PackedList< nBits >::operator[](), PackedList< nBits >::remove(), PackedList< nBits >::set(), and PackedList< nBits >::unset().

|
inlineprotected |
Construct from base list and position index.
|
inlineprotected |
Get value as unsigned, no range-checking.
Definition at line 290 of file PackedListI.H.
References PackedList< nBits >::iteratorBase::index_, PackedList< nBits >::iteratorBase::list_, PackedList< nBits >::max_value(), and PackedList< nBits >::packing().

|
inlineprotected |
Set value, returning true if changed, no range-checking.
Definition at line 302 of file PackedListI.H.
References PackedList< nBits >::iteratorBase::index_, PackedList< nBits >::iteratorBase::list_, PackedList< nBits >::max_value(), and PackedList< nBits >::packing().

|
inline |
Return the element index corresponding to the iterator.
Definition at line 329 of file PackedListI.H.
References PackedList< nBits >::iteratorBase::index_.
|
inline |
Write index/value for a non-zero entry.
The bool specialization writes the index only
Definition at line 146 of file PackedListI.H.
References token::BEGIN_LIST, token::END_LIST, and token::SPACE.
|
inline |
Compare values (not positions)
Definition at line 337 of file PackedListI.H.
References PackedList< nBits >::get().

|
inline |
Definition at line 347 of file PackedListI.H.
References PackedList< nBits >::get().

|
inline |
Assign value, not position.
This allows packed[0] = packed[3] for assigning values
Definition at line 357 of file PackedListI.H.
References PackedList< nBits >::get().

|
inline |
Assign value.
A non-existent entry will be auto-vivified.
Definition at line 368 of file PackedListI.H.
References PackedList< nBits >::iteratorBase::index_, PackedList< nBits >::iteratorBase::list_, and PackedList< nBits >::resize().

|
inline |
Conversion operator.
Never auto-vivify entries.
Definition at line 384 of file PackedListI.H.
References PackedList< nBits >::iteratorBase::index_, and PackedList< nBits >::iteratorBase::list_.
| Foam::Ostream & printInfo | ( | Ostream & | os | ) | const |
Print information and values.
Definition at line 149 of file PackedList.C.
References Foam::nl, and PackedList< nBits >::printBits().
Referenced by PackedList< nBits >::values().


|
inline |
Definition at line 86 of file PackedListI.H.
|
friend |
Definition at line 423 of file PackedList.H.
|
protected |
Pointer to original list.
This also lets us use the default bitwise copy/assignment
Definition at line 431 of file PackedList.H.
Referenced by PackedList< nBits >::const_iterator::const_iterator(), PackedList< nBits >::iteratorBase::get(), PackedList< nBits >::iterator::iterator(), PackedList< nBits >::iteratorBase::iteratorBase(), PackedList< nBits >::iteratorBase::operator unsigned int(), PackedList< nBits >::iteratorBase::operator=(), PackedList< nBits >::iterator::operator=(), PackedList< nBits >::const_iterator::operator=(), and PackedList< nBits >::iteratorBase::set().
|
protected |
Element index.
Definition at line 434 of file PackedList.H.
Referenced by PackedList< nBits >::const_iterator::const_iterator(), PackedList< nBits >::iteratorBase::get(), PackedList< nBits >::iterator::iterator(), PackedList< nBits >::iteratorBase::iteratorBase(), PackedList< nBits >::iteratorBase::key(), PackedList< nBits >::iteratorBase::operator unsigned int(), PackedList< nBits >::iterator::operator!=(), PackedList< nBits >::const_iterator::operator!=(), PackedList< nBits >::iterator::operator++(), PackedList< nBits >::const_iterator::operator++(), PackedList< nBits >::iterator::operator--(), PackedList< nBits >::const_iterator::operator--(), PackedList< nBits >::iteratorBase::operator=(), PackedList< nBits >::iterator::operator=(), PackedList< nBits >::const_iterator::operator=(), PackedList< nBits >::iterator::operator==(), PackedList< nBits >::const_iterator::operator==(), and PackedList< nBits >::iteratorBase::set().
1.8.11