The iterator base for HashTable. More...
Public Member Functions | |
const Key & | key () const |
Return the Key corresponding to the iterator. More... | |
bool | operator== (const iteratorBase &) const |
Compare hashedEntry element pointers. More... | |
bool | operator!= (const iteratorBase &) const |
bool | operator== (const iteratorEnd &unused) const |
Compare hashedEntry to iteratorEnd pointers. More... | |
bool | operator!= (const iteratorEnd &unused) const |
Protected Member Functions | |
iteratorBase () | |
Construct null - equivalent to an 'end' position. More... | |
iteratorBase (const HashTable< T, Key, Hash > *curHashTable) | |
Construct from hash table, moving to its 'begin' position. More... | |
iteratorBase (const HashTable< T, Key, Hash > *curHashTable, const hashedEntry *elmt, const label hashIndex) | |
Construct from hash table, element and hash index. More... | |
void | increment () |
Increment to the next position. More... | |
bool | erase () |
Erase the HashTable element at the current position. More... | |
T & | object () |
Return non-const access to referenced object. More... | |
const T & | cobject () const |
Return const access to referenced object. More... | |
Private Attributes | |
HashTable< T, Key, Hash > * | hashTable_ |
Pointer to the HashTable for which this is an iterator. More... | |
hashedEntry * | entryPtr_ |
Current element. More... | |
label | hashIndex_ |
Current hash index. More... | |
The iterator base for HashTable.
Note: data and functions are protected, to allow reuse by iterator and prevent most external usage. iterator and const_iterator have the same size, allowing us to reinterpret_cast between them (if desired)
Definition at line 343 of file HashTable.H.
|
inlineprotected |
Construct null - equivalent to an 'end' position.
Definition at line 162 of file HashTableI.H.
|
inlineexplicitprotected |
Construct from hash table, moving to its 'begin' position.
|
inlineprotected |
Construct from hash table, element and hash index.
|
inlineprotected |
Increment to the next position.
Definition at line 216 of file HashTableI.H.
References HashTable::tableSize_.
|
protected |
Erase the HashTable element at the current position.
Definition at line 311 of file HashTable.C.
References HashTable::iteratorBase::entryPtr_, HashTable::iteratorBase::hashIndex_, HashTable::iteratorBase::hashTable_, and HashTable::hashedEntry::next_.
|
inlineprotected |
Return non-const access to referenced object.
Definition at line 268 of file HashTableI.H.
|
inlineprotected |
Return const access to referenced object.
Definition at line 276 of file HashTableI.H.
|
inline |
Return the Key corresponding to the iterator.
Definition at line 260 of file HashTableI.H.
Referenced by topoSet::addSet(), topoSet::deleteSet(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::erase(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::operator=(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::operator==(), HashTable< Foam::autoPtr< Foam::interfaceCompositionModel > >::resize(), topoSet::subset(), regionSizeDistribution::write(), and topoSet::writeDebug().
|
inline |
Compare hashedEntry element pointers.
|
inline |
|
inline |
Compare hashedEntry to iteratorEnd pointers.
|
inline |
Pointer to the HashTable for which this is an iterator.
This also lets us use the default bitwise copy/assignment
Definition at line 349 of file HashTable.H.
Referenced by HashTable::iteratorBase::erase().
|
private |
Current element.
Definition at line 352 of file HashTable.H.
Referenced by HashTable::iteratorBase::erase().
|
private |
Current hash index.
Definition at line 355 of file HashTable.H.
Referenced by HashTable::iteratorBase::erase().
Copyright © 2011-2018 OpenFOAM | OPENFOAM® is a registered trademark of OpenCFD Ltd.