Loading...
Searching...
No Matches
HashTable< T, Key, Hash >::iterator Class Reference

Forward iterator with non-const access. More...

#include <HashTable.H>

Inheritance diagram for HashTable< T, Key, Hash >::iterator:
Collaboration diagram for HashTable< T, Key, Hash >::iterator:

Public Types

using iterator_category = std::forward_iterator_tag
using difference_type = this_type::difference_type
using node_type = this_type::node_type
using key_type = this_type::key_type
using mapped_type = this_type::mapped_type
using value_type = this_type::value_type
using pointer = this_type::pointer
using reference = this_type::reference
using const_pointer = this_type::const_pointer
using const_reference = this_type::const_reference
Public Types inherited from HashTable< T, Key, Hash >::Iterator< false >
using iterator_category
using difference_type
using table_type
 The HashTable container type.
using node_type
 The node-type being addressed.
using key_type
 The key type.
using mapped_type
 The object type being addressed.

Public Member Functions

 iterator ()=default
 Default construct (end iterator).
 iterator (const Iterator< false > &iter)
 Copy construct from similar access type.
const node_typenode () const noexcept
 Const access to the entry (node).
node_typenode () noexcept
 Non-const access to the entry (node).
const_reference val () const
 Const access to referenced object (value).
reference val ()
 Non-const access to referenced object (value).
const_reference operator* () const
 Const access to referenced object (value).
const_reference operator() () const
reference operator* ()
 Non-const access to referenced object (value).
reference operator() ()
iteratoroperator++ ()
iterator operator++ (int)
Public Member Functions inherited from HashTable< T, Key, Hash >::Iterator< false >
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.
Ostreamprint (Ostream &os) const
 Write the (key, val) pair.
 operator bool () const noexcept
 True if iterator points to an entry.
bool operator== (const Iterator< Any > &iter) const noexcept
 Compare hash-entry element pointers.
bool operator!= (const Iterator< Any > &iter) const noexcept

Additional Inherited Members

Protected Member Functions inherited from HashTable< T, Key, Hash >::Iterator< false >
constexpr Iterator () noexcept
 Default construct. Also the same as the end iterator.
void increment ()
 Increment to the next position.
 operator const Iterator< Any > & () const
 Permit explicit cast to the other (const/non-const) iterator.
Protected Attributes inherited from HashTable< T, Key, Hash >::Iterator< false >
node_typeentry_
 The selected entry.
table_typecontainer_
 The hash-table container being iterated on.
label index_
 Index within the hash-table data.

Detailed Description

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
class Foam::HashTable< T, Key, Hash >::iterator

Forward iterator with non-const access.

Definition at line 1040 of file HashTable.H.

Member Typedef Documentation

◆ iterator_category

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using iterator_category = std::forward_iterator_tag

Definition at line 1047 of file HashTable.H.

◆ difference_type

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using difference_type = this_type::difference_type

Definition at line 1048 of file HashTable.H.

◆ node_type

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using node_type = this_type::node_type

Definition at line 1050 of file HashTable.H.

◆ key_type

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using key_type = this_type::key_type

Definition at line 1051 of file HashTable.H.

◆ mapped_type

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using mapped_type = this_type::mapped_type

Definition at line 1052 of file HashTable.H.

◆ value_type

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using value_type = this_type::value_type

Definition at line 1053 of file HashTable.H.

◆ pointer

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using pointer = this_type::pointer

Definition at line 1054 of file HashTable.H.

◆ reference

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using reference = this_type::reference

Definition at line 1055 of file HashTable.H.

◆ const_pointer

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using const_pointer = this_type::const_pointer

Definition at line 1056 of file HashTable.H.

◆ const_reference

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
using const_reference = this_type::const_reference

Definition at line 1057 of file HashTable.H.

Constructor & Destructor Documentation

◆ iterator() [1/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
iterator ( )
default

Default construct (end iterator).

Referenced by operator++().

Here is the caller graph for this function:

◆ iterator() [2/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
iterator ( const Iterator< false > & iter)
inlineexplicit

Copy construct from similar access type.

Definition at line 1070 of file HashTable.H.

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

Here is the call graph for this function:

Member Function Documentation

◆ node() [1/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
const node_type * node ( ) const
inlinenoexcept

Const access to the entry (node).

Definition at line 1081 of file HashTable.H.

References HashTable< T, Key, Hash >::Iterator< Const >::entry_, and Foam::noexcept.

◆ node() [2/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
node_type * node ( )
inlinenoexcept

Non-const access to the entry (node).

Definition at line 1089 of file HashTable.H.

References HashTable< T, Key, Hash >::Iterator< Const >::entry_, and Foam::noexcept.

◆ val() [1/2]

◆ val() [2/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
reference val ( )
inline

Non-const access to referenced object (value).

Definition at line 1105 of file HashTable.H.

References HashTable< T, Key, Hash >::Iterator< Const >::entry_.

◆ operator*() [1/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
const_reference operator* ( ) const
inline

Const access to referenced object (value).

Definition at line 1113 of file HashTable.H.

References val().

Here is the call graph for this function:

◆ operator()() [1/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
const_reference operator() ( ) const
inline

Definition at line 1114 of file HashTable.H.

References val().

Here is the call graph for this function:

◆ operator*() [2/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
reference operator* ( )
inline

Non-const access to referenced object (value).

Definition at line 1119 of file HashTable.H.

References val().

Here is the call graph for this function:

◆ operator()() [2/2]

template<class T, class Key = word, class Hash = Foam::Hash<Key>>
reference operator() ( )
inline

Definition at line 1120 of file HashTable.H.

References val().

Here is the call graph for this function:

◆ operator++() [1/2]

template<class T, class Key, class Hash>
Foam::HashTable< T, Key, Hash >::iterator & operator++ ( )
inline

Definition at line 125 of file HashTableIterI.H.

References HashTable< T, Key, Hash >::Iterator< false >::increment().

Here is the call graph for this function:

◆ operator++() [2/2]

template<class T, class Key, class Hash>
Foam::HashTable< T, Key, Hash >::iterator operator++ ( int )
inline

Definition at line 134 of file HashTableIterI.H.

References HashTable< T, Key, Hash >::Iterator< false >::increment(), and iterator().

Here is the call graph for this function:

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