Internally used base for iterator and const_iterator. More...
#include <HashTable.H>

Public Types | |
| using | iterator_category = std::forward_iterator_tag |
| using | difference_type = this_type::difference_type |
| using | table_type |
| The HashTable container type. | |
| using | node_type |
| The node-type being addressed. | |
| using | key_type = this_type::key_type |
| The key type. | |
| using | mapped_type |
| The object type being addressed. | |
Public Member Functions | |
| bool | good () const noexcept |
| True if iterator points to an entry. | |
| bool | found () const noexcept |
| True if iterator points to an entry - same as good(). | |
| const Key & | key () const |
| The key associated with the iterator. | |
| Ostream & | print (Ostream &os) const |
| Write the (key, val) pair. | |
| operator bool () const noexcept | |
| True if iterator points to an entry. | |
| template<bool Any> | |
| bool | operator== (const Iterator< Any > &iter) const noexcept |
| Compare hash-entry element pointers. | |
| template<bool Any> | |
| bool | operator!= (const Iterator< Any > &iter) const noexcept |
Protected Member Functions | |
| constexpr | Iterator () noexcept |
| Default construct. Also the same as the end iterator. | |
| Iterator (table_type *tbl) | |
| Construct from begin of hash-table. | |
| Iterator (table_type *tbl, const Key &key) | |
| Construct by finding key in hash table. | |
| void | increment () |
| Increment to the next position. | |
| template<bool Any> | |
| operator const Iterator< Any > & () const | |
| Permit explicit cast to the other (const/non-const) iterator. | |
Protected Attributes | |
| node_type * | entry_ |
| The selected entry. | |
| table_type * | container_ |
| The hash-table container being iterated on. | |
| label | index_ |
| Index within the hash-table data. | |
Friends | |
| class | HashTable |
Internally used base for iterator and const_iterator.
The iterator base for HashTable (internal use only).
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 871 of file HashTable.H.
| using iterator_category = std::forward_iterator_tag |
Definition at line 876 of file HashTable.H.
| using difference_type = this_type::difference_type |
Definition at line 877 of file HashTable.H.
| using table_type |
The HashTable container type.
Definition at line 882 of file HashTable.H.
| using node_type |
The node-type being addressed.
Definition at line 892 of file HashTable.H.
| using key_type = this_type::key_type |
The key type.
Definition at line 902 of file HashTable.H.
| using mapped_type |
The object type being addressed.
Definition at line 907 of file HashTable.H.
|
inlineconstexprprotectednoexcept |
Default construct. Also the same as the end iterator.
Definition at line 26 of file HashTableIterI.H.
References container_, entry_, index_, Iterator(), and Foam::noexcept.
Referenced by HashTable, Iterator(), Iterator(), Iterator(), operator const Iterator< Any > &(), operator!=(), and operator==().


|
inlineexplicitprotected |
Construct from begin of hash-table.
Definition at line 36 of file HashTableIterI.H.
References container_, entry_, if(), index_, and Iterator().

|
protected |
Construct by finding key in hash table.
Definition at line 25 of file HashTableIter.C.
References container_, entry_, index_, Iterator(), and key().

Increment to the next position.
Definition at line 72 of file HashTableIterI.H.
References container_, entry_, increment(), and index_.
Referenced by HashTable, and increment().


|
inlineexplicitprotected |
Permit explicit cast to the other (const/non-const) iterator.
Definition at line 975 of file HashTable.H.
References Iterator(), and HashTable< T, Key, Hash >::operator.

|
inlinenoexcept |
True if iterator points to an entry.
This can be used directly instead of comparing to end()
Definition at line 990 of file HashTable.H.
References entry_, and Foam::noexcept.
Referenced by HashTable< T, Key, Hash >::at(), HashTable< T, Key, Hash >::at(), HashTable< T, Key, Hash >::contains(), HashTable< T, Key, Hash >::erase(), HashTable< T, Key, Hash >::lookup(), HashTable< T, Key, Hash >::operator()(), HashTable< T, Key, Hash >::operator()(), and HashTable< T, Key, Hash >::operator==().

|
inlinenoexcept |
True if iterator points to an entry - same as good().
Definition at line 995 of file HashTable.H.
References entry_, and Foam::noexcept.
|
inline |
The key associated with the iterator.
Definition at line 1000 of file HashTable.H.
References entry_.
Referenced by HashTable< T, Key, HashType >::erase(), HashTable< T, Key, HashType >::filterEntries(), HashTable< T, Key, HashType >::filterKeys(), HashTable, Iterator(), HashTable< T, Key, Hash >::merge(), HashTable< T, Key, Hash >::operator+=(), HashTable< T, Key, Hash >::operator==(), and HashTable< T, Key, HashType >::retain().

|
inline |
|
inlineexplicitnoexcept |
True if iterator points to an entry.
This can be used directly instead of comparing to end()
Definition at line 1015 of file HashTable.H.
References entry_, and Foam::noexcept.
|
inlinenoexcept |
Compare hash-entry element pointers.
Independent of const/non-const access
Definition at line 1023 of file HashTable.H.
References entry_, and Iterator().

|
inlinenoexcept |
Definition at line 1029 of file HashTable.H.
References entry_, and Iterator().

|
friend |
Definition at line 943 of file HashTable.H.
References HashTable, increment(), Iterator(), key(), and Foam::noexcept.
Referenced by HashTable.
|
protected |
The selected entry.
MUST be the first member for easy comparison between iterators and to support reinterpret_cast from nullObject
Definition at line 925 of file HashTable.H.
Referenced by found(), good(), increment(), Iterator(), Iterator(), Iterator(), key(), HashTable< T, Key, Hash >::const_iterator::node(), HashTable< T, Key, Hash >::iterator::node(), HashTable< T, Key, Hash >::iterator::node(), operator bool(), operator!=(), operator==(), print(), HashTable< T, Key, Hash >::const_iterator::val(), HashTable< T, Key, Hash >::iterator::val(), and HashTable< T, Key, Hash >::iterator::val().
|
protected |
The hash-table container being iterated on.
Uses pointer for default copy/assignment
Definition at line 932 of file HashTable.H.
Referenced by increment(), Iterator(), Iterator(), and Iterator().
|
protected |
Index within the hash-table data.
A signed value, since iterator_erase() needs a negative value to mark the position.
Definition at line 940 of file HashTable.H.
Referenced by increment(), Iterator(), Iterator(), and Iterator().