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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator Class Reference

Forward iterator for FastHashSet that skips empty buckets. More...

#include <nfx/containers/FastHashSet.h>

Public Types

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

Public Member Functions

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

Friends

class ConstIterator

Detailed Description

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator

Forward iterator for FastHashSet that skips empty buckets.

Provides STL-compatible iteration over occupied buckets only. Automatically skips empty buckets during traversal for efficiency.

Definition at line 533 of file FastHashSet.h.

Member Typedef Documentation

◆ difference_type

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::difference_type = std::ptrdiff_t

STL iterator difference type.

Definition at line 545 of file FastHashSet.h.

◆ iterator_category

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::iterator_category = std::forward_iterator_tag

STL iterator category (forward iterator).

Definition at line 539 of file FastHashSet.h.

◆ pointer

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::pointer = const TKey*

STL iterator pointer type.

Definition at line 548 of file FastHashSet.h.

◆ reference

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::reference = const TKey&

STL iterator reference type.

Definition at line 551 of file FastHashSet.h.

◆ value_type

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::value_type = const TKey

STL iterator value type (key).

Definition at line 542 of file FastHashSet.h.

Constructor & Destructor Documentation

◆ Iterator()

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::Iterator ( Bucket * bucket,
Bucket * end )
inline

Construct iterator from bucket range.

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

Member Function Documentation

◆ operator!=()

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::operator!= ( const Iterator & other) const
inline

Inequality comparison operator.

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

◆ operator*()

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::operator* ( ) const
inline

Dereference operator to access key.

Returns
Reference to current key

◆ operator++() [1/2]

template<typename TKey, 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<>>
Iterator & nfx::containers::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::operator++ ( )
inline

Pre-increment operator to advance to next occupied bucket.

Returns
Reference to this iterator after advancement

◆ operator++() [2/2]

template<typename TKey, 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<>>
Iterator nfx::containers::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::operator++ ( int )
inline

Post-increment operator to advance to next occupied bucket.

Returns
Copy of iterator before advancement

◆ operator->()

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::operator-> ( ) const
inline

Arrow operator to access key.

Returns
Pointer to current key

◆ operator==()

template<typename TKey, 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::FastHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::operator== ( const Iterator & other) const
inline

Equality comparison operator.

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

◆ ConstIterator

template<typename TKey, 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 ConstIterator
friend

Definition at line 535 of file FastHashSet.h.


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