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 >::Iterator Class Reference

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

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

Friends

class ConstIterator
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 >::Iterator

Iterator for OrderedHashSet that follows insertion order.

Definition at line 553 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 >::Iterator::difference_type = std::ptrdiff_t

STL iterator difference type.

Definition at line 566 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 >::Iterator::iterator_category = std::bidirectional_iterator_tag

STL iterator category (bidirectional iterator).

Definition at line 560 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 >::Iterator::pointer = const TKey*

STL iterator pointer type.

Definition at line 569 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 >::Iterator::reference = const TKey&

STL iterator reference type.

Definition at line 572 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 >::Iterator::value_type = const TKey

STL iterator value type (const key).

Definition at line 563 of file OrderedHashSet.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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::Iterator ( Node * node)
inlineexplicit

Construct iterator from node.

Parameters
nodeNode pointer (nullptr for end iterator)

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 >::Iterator::operator!= ( const Iterator & 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 >::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::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::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<>>
Iterator nfx::containers::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::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<>>
Iterator & nfx::containers::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::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<>>
Iterator nfx::containers::OrderedHashSet< TKey, HashType, Seed, THasher, KeyEqual >::Iterator::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 >::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::OrderedHashSet< 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 node

◆ 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 555 of file OrderedHashSet.h.

◆ 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 556 of file OrderedHashSet.h.


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