nCine 2025.07.r505-7e70e87
A cross-platform 2D game engine
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
nctl::StaticHashMapIterator< K, T, HashFunc, Capacity, IsConst > Class Template Reference

A hashmap iterator. More...

#include <StaticHashMapIterator.h>

Public Types

enum class  SentinelTagInit { BEGINNING , END }
 Sentinel tags to initialize the iterator at the beginning and end. More...
 
using Reference = typename IteratorTraits< StaticHashMapIterator >::Reference
 Reference type which respects iterator constness.
 

Public Member Functions

 StaticHashMapIterator (typename StaticHashMapHelperTraits< K, T, HashFunc, Capacity, IsConst >::HashMapPtr hashMap, unsigned int bucketIndex)
 
 StaticHashMapIterator (typename StaticHashMapHelperTraits< K, T, HashFunc, Capacity, IsConst >::HashMapPtr hashMap, SentinelTagInit tag)
 
 StaticHashMapIterator (const StaticHashMapIterator< K, T, HashFunc, Capacity, false > &it)
 Copy constructor to implicitly convert a non constant iterator to a constant one.
 
Reference operator* () const
 Deferencing operator.
 
StaticHashMapIteratoroperator++ ()
 Iterates to the next element (prefix)
 
StaticHashMapIterator operator++ (int)
 Iterates to the next element (postfix)
 
StaticHashMapIteratoroperator-- ()
 Iterates to the previous element (prefix)
 
StaticHashMapIterator operator-- (int)
 Iterates to the previous element (postfix)
 
StaticHashMapHelperTraits< K, T, HashFunc, Capacity, IsConst >::NodeReference node () const
 Returns the hashmap node currently pointed by the iterator.
 
const T & value () const
 Returns the value associated to the currently pointed node.
 
const K & key () const
 Returns the key associated to the currently pointed node.
 
hash_t hash () const
 Returns the hash associated to the currently pointed node.
 

Friends

class StaticHashMapIterator< K, T, HashFunc, Capacity, true >
 For non constant to constant iterator implicit conversion.
 
bool operator== (const StaticHashMapIterator &lhs, const StaticHashMapIterator &rhs)
 Equality operator.
 
bool operator!= (const StaticHashMapIterator &lhs, const StaticHashMapIterator &rhs)
 Inequality operator.
 

Detailed Description

template<class K, class T, class HashFunc, unsigned int Capacity, bool IsConst>
class nctl::StaticHashMapIterator< K, T, HashFunc, Capacity, IsConst >

A hashmap iterator.

Member Enumeration Documentation

◆ SentinelTagInit

Sentinel tags to initialize the iterator at the beginning and end.

Enumerator
BEGINNING 

Iterator at the beginning, next element is the first one.

END 

Iterator at the end, previous element is the last one.


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