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

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

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

Public Types

using iterator_category = std::forward_iterator_tag
 
using difference_type = this_type::difference_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 = std::forward_iterator_tag
 
using difference_type = this_type::difference_type
 
using table_type = typename std::conditional< Const, const this_type, this_type >::type
 The HashTable container type. More...
 
using node_type = typename std::conditional< Const, const this_type::node_type, this_type::node_type >::type
 The node-type being addressed. More...
 
using key_type = this_type::key_type
 The key type. More...
 
using mapped_type = typename std::conditional< Const, const this_type::mapped_type, this_type::mapped_type >::type
 The object type being addressed. More...
 

Public Member Functions

 iterator ()=default
 Default construct (end iterator) More...
 
 iterator (const Iterator< false > &iter)
 Copy construct from similar access type. More...
 
const_reference val () const
 Const access to referenced object (value) More...
 
reference val ()
 Non-const access to referenced object (value) More...
 
const_reference operator* () const
 Const access to referenced object (value) More...
 
const_reference operator() () const
 
reference operator* ()
 Non-const access to referenced object (value) More...
 
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. More...
 
bool found () const noexcept
 True if iterator points to an entry - same as good() More...
 
const Key & key () const
 The key associated with the iterator. More...
 
Ostreamprint (Ostream &os) const
 Write the (key, val) pair. More...
 
 operator bool () const noexcept
 True if iterator points to an entry. More...
 
bool operator== (const Iterator< Any > &iter) const noexcept
 Compare hash-entry element pointers. More...
 
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 (end iterator) More...
 
 Iterator (table_type *tbl)
 Construct from begin of hash-table. More...
 
 Iterator (table_type *tbl, const Key &key)
 Construct by finding key in hash table. More...
 
void increment ()
 Increment to the next position. More...
 
 operator const Iterator< Any > & () const
 Permit explicit cast to the other (const/non-const) iterator. More...
 
- Protected Attributes inherited from HashTable< T, Key, Hash >::Iterator< false >
node_typeentry_
 The selected entry. More...
 
table_typecontainer_
 The hash-table container being iterated on. More...
 
label index_
 Index within the hash-table data. More...
 

Detailed Description

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

Forward iterator with non-const access.

Definition at line 676 of file HashTable.H.

Member Typedef Documentation

◆ iterator_category

using iterator_category = std::forward_iterator_tag

Definition at line 683 of file HashTable.H.

◆ difference_type

Definition at line 684 of file HashTable.H.

◆ key_type

Definition at line 686 of file HashTable.H.

◆ mapped_type

Definition at line 687 of file HashTable.H.

◆ value_type

Definition at line 688 of file HashTable.H.

◆ pointer

Definition at line 689 of file HashTable.H.

◆ reference

Definition at line 690 of file HashTable.H.

◆ const_pointer

using const_pointer = this_type::const_pointer

Definition at line 691 of file HashTable.H.

◆ const_reference

using const_reference = this_type::const_reference

Definition at line 692 of file HashTable.H.

Constructor & Destructor Documentation

◆ iterator() [1/2]

iterator ( )
default

Default construct (end iterator)

◆ iterator() [2/2]

iterator ( const Iterator< false > &  iter)
inlineexplicit

Copy construct from similar access type.

Definition at line 701 of file HashTable.H.

Member Function Documentation

◆ val() [1/2]

const_reference val ( ) const
inline

Const access to referenced object (value)

Definition at line 710 of file HashTable.H.

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

Here is the caller graph for this function:

◆ val() [2/2]

reference val ( )
inline

Non-const access to referenced object (value)

Definition at line 716 of file HashTable.H.

◆ operator*() [1/2]

const_reference operator* ( ) const
inline

Const access to referenced object (value)

Definition at line 722 of file HashTable.H.

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

Here is the call graph for this function:

◆ operator()() [1/2]

const_reference operator() ( ) const
inline

Definition at line 723 of file HashTable.H.

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

Here is the call graph for this function:

◆ operator*() [2/2]

reference operator* ( )
inline

Non-const access to referenced object (value)

Definition at line 726 of file HashTable.H.

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

Here is the call graph for this function:

◆ operator()() [2/2]

reference operator() ( )
inline

Definition at line 727 of file HashTable.H.

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

Here is the call graph for this function:

◆ operator++() [1/2]

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

Definition at line 190 of file HashTableIterI.H.

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

Here is the call graph for this function:

◆ operator++() [2/2]

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

Definition at line 199 of file HashTableIterI.H.


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