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::HashMapIterator< K, T, HashFunc, IsConst > Class Template Reference

A hashmap iterator. More...

#include <HashMapIterator.h>

Public Types

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

Public Member Functions

 HashMapIterator (typename HashMapHelperTraits< K, T, HashFunc, IsConst >::HashMapPtr hashMap, unsigned int bucketIndex)
 
 HashMapIterator (typename HashMapHelperTraits< K, T, HashFunc, IsConst >::HashMapPtr hashMap, SentinelTagInit tag)
 
 HashMapIterator (const HashMapIterator< K, T, HashFunc, false > &it)
 Copy constructor to implicitly convert a non constant iterator to a constant one.
 
Reference operator* () const
 Deferencing operator.
 
HashMapIteratoroperator++ ()
 Iterates to the next element (prefix)
 
HashMapIterator operator++ (int)
 Iterates to the next element (postfix)
 
HashMapIteratoroperator-- ()
 Iterates to the previous element (prefix)
 
HashMapIterator operator-- (int)
 Iterates to the previous element (postfix)
 
HashMapHelperTraits< K, T, HashFunc, 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 HashMapIterator< K, T, HashFunc, true >
 For non constant to constant iterator implicit conversion.
 
bool operator== (const HashMapIterator &lhs, const HashMapIterator &rhs)
 Equality operator.
 
bool operator!= (const HashMapIterator &lhs, const HashMapIterator &rhs)
 Inequality operator.
 

Detailed Description

template<class K, class T, class HashFunc, bool IsConst>
class nctl::HashMapIterator< K, T, HashFunc, 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: