nfx-containers 0.6.0
Modern C++20 header-only library providing high-performance hash containers with Robin Hood and perfect hashing
Loading...
Searching...
No Matches
nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator Class Reference

Const iterator for HashMap that skips empty buckets. More...

#include <nfx/containers/FastHashMap.h>

Public Types

using iterator_category = std::forward_iterator_tag
 STL iterator category (forward iterator).
using value_type = std::pair<const TKey, TValue>
 STL iterator value type (const key-value pair).
using difference_type = std::ptrdiff_t
 STL iterator difference type.
using pointer = const value_type*
 STL iterator pointer type.
using reference = const value_type&
 STL iterator reference type.

Public Member Functions

 ConstIterator ()=default
 Default constructor creates an invalid iterator.
 ConstIterator (const Bucket *bucket, const Bucket *end)
 Construct const iterator from bucket range.
 ConstIterator (const Iterator &it)
 Convert from non-const iterator.
reference operator* () const
 Dereference operator to access key-value pair.
pointer operator-> () const
 Arrow operator to access key-value pair members.
ConstIteratoroperator++ ()
 Pre-increment operator to advance to next occupied bucket.
ConstIterator operator++ (int)
 Post-increment operator to advance to next occupied bucket.
bool operator== (const ConstIterator &other) const
 Equality comparison operator.
bool operator!= (const ConstIterator &other) const
 Inequality comparison operator.

Friends

class FastHashMap

Detailed Description

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
class nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator

Const iterator for HashMap that skips empty buckets.

Definition at line 733 of file FastHashMap.h.

Member Typedef Documentation

◆ difference_type

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
using nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::difference_type = std::ptrdiff_t

STL iterator difference type.

Definition at line 745 of file FastHashMap.h.

◆ iterator_category

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
using nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::iterator_category = std::forward_iterator_tag

STL iterator category (forward iterator).

Definition at line 739 of file FastHashMap.h.

◆ pointer

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
using nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::pointer = const value_type*

STL iterator pointer type.

Definition at line 748 of file FastHashMap.h.

◆ reference

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
using nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::reference = const value_type&

STL iterator reference type.

Definition at line 751 of file FastHashMap.h.

◆ value_type

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
using nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::value_type = std::pair<const TKey, TValue>

STL iterator value type (const key-value pair).

Definition at line 742 of file FastHashMap.h.

Constructor & Destructor Documentation

◆ ConstIterator() [1/2]

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::ConstIterator ( const Bucket * bucket,
const Bucket * end )
inline

Construct const iterator from bucket range.

Parameters
bucketStarting bucket pointer
endEnd bucket pointer (one past last bucket)

◆ ConstIterator() [2/2]

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::ConstIterator ( const Iterator & it)
inline

Convert from non-const iterator.

Parameters
itNon-const iterator to convert from

Member Function Documentation

◆ operator!=()

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
bool nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator!= ( const ConstIterator & other) const
inline

Inequality comparison operator.

Parameters
otherIterator to compare with
Returns
true if iterators point to different buckets

◆ operator*()

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
reference nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator* ( ) const
inline

Dereference operator to access key-value pair.

Returns
Const reference to current key-value pair

◆ operator++() [1/2]

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
ConstIterator & nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator++ ( )
inline

Pre-increment operator to advance to next occupied bucket.

Returns
Reference to this iterator after advancement

◆ operator++() [2/2]

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
ConstIterator nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator++ ( int )
inline

Post-increment operator to advance to next occupied bucket.

Returns
Copy of iterator before advancement

◆ operator->()

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
pointer nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator-> ( ) const
inline

Arrow operator to access key-value pair members.

Returns
Const pointer to current key-value pair

◆ operator==()

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
bool nfx::containers::FastHashMap< TKey, TValue, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator== ( const ConstIterator & other) const
inline

Equality comparison operator.

Parameters
otherIterator to compare with
Returns
true if iterators point to the same bucket

◆ FastHashMap

template<typename TKey, typename TValue, hashing::Hash32or64 HashType = uint32_t, HashType Seed = ( sizeof( HashType ) == 4 ? hashing::constants::FNV_OFFSET_BASIS_32 : hashing::constants::FNV_OFFSET_BASIS_64 ), typename THasher = hashing::Hasher<HashType, Seed>, typename KeyEqual = std::equal_to<>>
friend class FastHashMap
friend

Definition at line 735 of file FastHashMap.h.


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