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 354 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.

Referenced by HashTable< T, Key, Hash >::const_iterator::const_iterator(), HashTable< T, Key, Hash >::iterator::iterator(), and HashTable< T, Key, Hash >::iteratorBase::iteratorBase().

Here is the caller graph for this function:

◆ iteratorBase() [2/3]

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

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

Definition at line 166 of file HashTableI.H.

References HashTable< T, Key, Hash >::iteratorBase::iteratorBase().

Here is the call graph for this function:

◆ 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 196 of file HashTableI.H.

Member Function Documentation

◆ increment()

void increment ( )
inlineprotected

Increment to the next position.

Definition at line 210 of file HashTableI.H.

Referenced by HashTable< T, Key, Hash >::iterator::operator++(), and HashTable< T, Key, Hash >::const_iterator::operator++().

Here is the caller graph for this function:

◆ erase()

bool erase ( )
protected

Erase the HashTable element at the current position.

Definition at line 309 of file HashTable.C.

◆ object()

T & object ( )
inlineprotected

Return non-const access to referenced object.

Definition at line 262 of file HashTableI.H.

References Foam::T().

Referenced by HashTable< T, Key, Hash >::iterator::operator()(), and HashTable< T, Key, Hash >::iterator::operator*().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ cobject()

const T & cobject ( ) const
inlineprotected

◆ key()

const Key & key ( ) const
inline

Return the Key corresponding to the iterator.

Definition at line 254 of file HashTableI.H.

References Foam::T().

Referenced by regionSizeDistribution::write().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator==() [1/2]

bool operator== ( const iteratorBase iter) const
inline

Compare hashedEntry element pointers.

Definition at line 278 of file HashTableI.H.

◆ operator!=() [1/2]

bool operator!= ( const iteratorBase iter) const
inline

Definition at line 288 of file HashTableI.H.

◆ operator==() [2/2]

bool operator== ( const iteratorEnd unused) const
inline

Compare hashedEntry to iteratorEnd pointers.

Definition at line 298 of file HashTableI.H.

◆ operator!=() [2/2]

bool operator!= ( const iteratorEnd unused) const
inline

Definition at line 308 of file HashTableI.H.


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