HashTable< T, Key, Hash >::iteratorBase Class Reference

The iterator base for HashTable. More...

Inheritance diagram for HashTable< T, Key, Hash >::iteratorBase:

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...
 
Tobject ()
 Return non-const access to referenced object. More...
 
const Tcobject () const
 Return const access to referenced object. More...
 

Detailed Description

template<class T, class Key = word, class Hash = string::hash>
class Foam::HashTable< T, Key, Hash >::iteratorBase

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 368 of file HashTable.H.

Constructor & Destructor Documentation

◆ iteratorBase() [1/3]

iteratorBase
inlineprotected

Construct null - equivalent to an 'end' position.

Definition at line 156 of file HashTableI.H.

◆ iteratorBase() [2/3]

iteratorBase ( const HashTable< T, Key, Hash > *  curHashTable)
inlineexplicitprotected

Construct from hash table, moving to its 'begin' position.

Definition at line 165 of file HashTableI.H.

◆ iteratorBase() [3/3]

iteratorBase ( const HashTable< T, Key, Hash > *  curHashTable,
const hashedEntry *  elmt,
const label  hashIndex 
)
inlineprotected

Construct from hash table, element and hash index.

Definition at line 195 of file HashTableI.H.

Member Function Documentation

◆ increment()

void increment
inlineprotected

Increment to the next position.

Definition at line 210 of file HashTableI.H.

◆ erase()

bool erase
protected

Erase the HashTable element at the current position.

Definition at line 383 of file HashTable.C.

◆ object()

T & object
inlineprotected

Return non-const access to referenced object.

Definition at line 262 of file HashTableI.H.

◆ cobject()

const T & cobject
inlineprotected

Return const access to referenced object.

Definition at line 270 of file HashTableI.H.

◆ key()

const Key & key
inline

Return the Key corresponding to the iterator.

Definition at line 254 of file HashTableI.H.

◆ operator==() [1/2]

bool operator== ( const iteratorBase iter) const
inline

Compare hashedEntry element pointers.

Definition at line 277 of file HashTableI.H.

◆ operator!=() [1/2]

bool operator!= ( const iteratorBase iter) const
inline

Definition at line 287 of file HashTableI.H.

◆ operator==() [2/2]

bool operator== ( const iteratorEnd unused) const
inline

Compare hashedEntry to iteratorEnd pointers.

Definition at line 297 of file HashTableI.H.

◆ operator!=() [2/2]

bool operator!= ( const iteratorEnd unused) const
inline

Definition at line 307 of file HashTableI.H.


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