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

Forward iterator with const access. More...

Inheritance diagram for HashTable< T, Key, Hash >::const_iterator:
[legend]
Collaboration diagram for HashTable< T, Key, Hash >::const_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 = const this_type::mapped_type
 
using value_type = const this_type::value_type
 
using reference = this_type::const_reference
 
- Public Types inherited from HashTable< T, Key, Hash >::Iterator< true >
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

 const_iterator ()=default
 Construct null (end iterator) More...
 
 const_iterator (const Iterator< true > &iter)
 Copy construct from similar access type. More...
 
 const_iterator (const Iterator< false > &iter)
 Copy construct from dissimilar access type. More...
 
 const_iterator (const iterator &iter)
 Implicit conversion from dissimilar access type. More...
 
reference val () const
 Const access to referenced object (value) More...
 
reference operator* () const
 Const access to referenced object (value) More...
 
reference operator() () const
 
const_iteratoroperator++ ()
 
const_iterator operator++ (int)
 
const_iteratoroperator= (const const_iterator &)=default
 
const_iteratoroperator= (const iterator &iter)
 
- Public Member Functions inherited from HashTable< T, Key, Hash >::Iterator< true >
bool good () const
 True if iterator points to an entry. More...
 
bool found () const
 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< true > &iter) const
 Compare hash-entry element pointers. More...
 
bool operator== (const Iterator< false > &iter) const
 
bool operator!= (const Iterator< true > &iter) const
 
bool operator!= (const Iterator< false > &iter) const
 

Additional Inherited Members

- Protected Member Functions inherited from HashTable< T, Key, Hash >::Iterator< true >
 Iterator ()
 Construct null (end iterator) More...
 
 Iterator (bool, 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<!Const > & () const
 Permit an explicit cast to the other (const/non-const) searcher. More...
 
- Protected Attributes inherited from HashTable< T, Key, Hash >::Iterator< true >
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 >::const_iterator

Forward iterator with const access.

Definition at line 726 of file HashTable.H.

Member Typedef Documentation

◆ iterator_category

using iterator_category = std::forward_iterator_tag

Definition at line 732 of file HashTable.H.

◆ difference_type

Definition at line 733 of file HashTable.H.

◆ key_type

Definition at line 735 of file HashTable.H.

◆ mapped_type

Definition at line 736 of file HashTable.H.

◆ value_type

Definition at line 737 of file HashTable.H.

◆ reference

Definition at line 738 of file HashTable.H.

Constructor & Destructor Documentation

◆ const_iterator() [1/4]

const_iterator ( )
inlinedefault

Construct null (end iterator)

◆ const_iterator() [2/4]

const_iterator ( const Iterator< true > &  iter)
inlineexplicit

Copy construct from similar access type.

Definition at line 747 of file HashTable.H.

◆ const_iterator() [3/4]

const_iterator ( const Iterator< false > &  iter)
inlineexplicit

Copy construct from dissimilar access type.

Definition at line 753 of file HashTable.H.

◆ const_iterator() [4/4]

const_iterator ( const iterator iter)
inline

Implicit conversion from dissimilar access type.

Definition at line 762 of file HashTable.H.

Member Function Documentation

◆ val()

reference val ( ) const
inline

Const access to referenced object (value)

Definition at line 771 of file HashTable.H.

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

Here is the caller graph for this function:

◆ operator*()

reference operator* ( ) const
inline

Const access to referenced object (value)

Definition at line 777 of file HashTable.H.

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

Here is the call graph for this function:

◆ operator()()

reference operator() ( ) const
inline

Definition at line 778 of file HashTable.H.

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

Here is the call graph for this function:

◆ operator++() [1/2]

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

Definition at line 231 of file HashTableIterI.H.

◆ operator++() [2/2]

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

Definition at line 240 of file HashTableIterI.H.

◆ operator=() [1/2]

const_iterator& operator= ( const const_iterator )
default

◆ operator=() [2/2]

const_iterator& operator= ( const iterator iter)
inline

Definition at line 788 of file HashTable.H.


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