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

Const iterator for OrderedHashSet that follows insertion order. More...

#include <nfx/containers/OrderedHashSet.h>

Public Types

using iterator_category = std::bidirectional_iterator_tag
 STL iterator category (bidirectional iterator).
using value_type = const TKey
 STL iterator value type (const 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

 ConstIterator ()=default
 Default constructor creates an invalid iterator.
 ConstIterator (const Node *node)
 Construct const iterator from node.
 ConstIterator (const Iterator &it)
 Convert from non-const iterator.
reference operator* () const
 Dereference operator to access key.
pointer operator-> () const
 Arrow operator to access key.
ConstIteratoroperator++ ()
 Pre-increment operator to advance to next element in insertion order.
ConstIterator operator++ (int)
 Post-increment operator to advance to next element in insertion order.
ConstIteratoroperator-- ()
 Pre-decrement operator to move to previous element in insertion order.
ConstIterator operator-- (int)
 Post-decrement operator to move to previous element in insertion order.
bool operator== (const ConstIterator &other) const
 Equality comparison operator.
bool operator!= (const ConstIterator &other) const
 Inequality comparison operator.

Friends

class OrderedHashSet

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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator

Const iterator for OrderedHashSet that follows insertion order.

Definition at line 670 of file OrderedHashSet.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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::difference_type = std::ptrdiff_t

STL iterator difference type.

Definition at line 682 of file OrderedHashSet.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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::iterator_category = std::bidirectional_iterator_tag

STL iterator category (bidirectional iterator).

Definition at line 676 of file OrderedHashSet.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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::pointer = const TKey*

STL iterator pointer type.

Definition at line 685 of file OrderedHashSet.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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::reference = const TKey&

STL iterator reference type.

Definition at line 688 of file OrderedHashSet.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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::value_type = const TKey

STL iterator value type (const key).

Definition at line 679 of file OrderedHashSet.h.

Constructor & Destructor Documentation

◆ ConstIterator() [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<>>
nfx::containers::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::ConstIterator ( const Node * node)
inlineexplicit

Construct const iterator from node.

Parameters
nodeNode pointer (nullptr for end iterator)

◆ ConstIterator() [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<>>
nfx::containers::OrderedHashSet< TKey, 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, 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::OrderedHashSet< TKey, 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 nodes

◆ 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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator* ( ) const
inline

Dereference operator to access key.

Returns
Const 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<>>
ConstIterator & nfx::containers::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator++ ( )
inline

Pre-increment operator to advance to next element in insertion order.

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<>>
ConstIterator nfx::containers::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator++ ( int )
inline

Post-increment operator to advance to next element in insertion order.

Returns
Copy of iterator before advancement

◆ 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<>>
ConstIterator & nfx::containers::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator-- ( )
inline

Pre-decrement operator to move to previous element in insertion order.

Returns
Reference to this iterator after moving backward

◆ 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<>>
ConstIterator nfx::containers::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator-- ( int )
inline

Post-decrement operator to move to previous element in insertion order.

Returns
Copy of iterator before moving backward

◆ 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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::ConstIterator::operator-> ( ) const
inline

Arrow operator to access key.

Returns
Const 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::OrderedHashSet< TKey, 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 node

◆ OrderedHashSet

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 OrderedHashSet
friend

Definition at line 672 of file OrderedHashSet.h.


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