Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Burger::HashMapShared::const_iterator Class Reference

STL compatible iterator base class. More...

Inheritance diagram for Burger::HashMapShared::const_iterator:
Collaboration diagram for Burger::HashMapShared::const_iterator:

Public Member Functions

uint_t IsEnd (void) const noexcept
 Is the iterator at the end of the array?
 
const EntryGetPtr (void) const noexcept
 Get the Entry pointer.
 
const Entryoperator* () const noexcept
 Get the Entry reference.
 
const Entryoperator-> () const noexcept
 Get the Entry pointer.
 
void operator++ () noexcept
 Increment the iterator to the next valid entry.
 
uint_t operator== (const const_iterator &it) const noexcept
 Test for equality between iterators.
 
uint_t operator!= (const const_iterator &it) const noexcept
 Test for inequality between iterators.
 

Protected Member Functions

 const_iterator (const HashMapShared *pParent, uintptr_t uIndex) noexcept
 Base class constructor.
 

Protected Attributes

const HashMapSharedm_pParent
 Pointer to the parent class instance.
 
uintptr_t m_uIndex
 Last accessed index.
 

Detailed Description

STL compatible iterator base class.


This class is the base class for iteration over a hash table using standard STL algorithms. It's not meant to be used by applications. A HashMap will derive from this class to inherit the common functionality and then provide access to the specialized key and data pairs.

See also
HashMap::const_iterator or HashMap::iterator

Constructor & Destructor Documentation

◆ const_iterator()

Burger::HashMapShared::const_iterator::const_iterator ( const HashMapShared * pParent,
uintptr_t uIndex )
inlineprotectednoexcept

Base class constructor.


This class is initialized with a pointer to the parent class and an index to start iteration. If uIndex is set to INVALID_INDEX, it's assumed to be an HashMap::end() marker.

Parameters
pParentPointer to the parent class
uIndexIndex to start iteration from (Must an index to a valid entry or INVALID_INDEX)
See also
HashMap::const_iterator or HashMap::iterator

Member Function Documentation

◆ GetPtr()

const Entry * Burger::HashMapShared::const_iterator::GetPtr ( void ) const
inlinenoexcept

Get the Entry pointer.


Given an iterator that's pointing to a valid object, return a pointer to the Entry. This function returns the base class which the derived HashMap will up cast to the true data type.

Returns
Pointer to the specific entry the iterator is pointing to.
See also
IsEnd()

◆ IsEnd()

uint_t Burger::HashMapShared::const_iterator::IsEnd ( void ) const
inlinenoexcept

Is the iterator at the end of the array?


Returns
TRUE if the iterator is not pointing to a valid entry.
See also
GetPtr(void) const

◆ operator!=()

uint_t Burger::HashMapShared::const_iterator::operator!= ( const const_iterator & it) const
inlinenoexcept

Test for inequality between iterators.


If two iterators point different indexes, return TRUE

Parameters
itReference to iterator to test against this one
Returns
TRUE if the iterators do not match, FALSE if they do.
See also
operator==(const const_iterator&) const

◆ operator*()

const Entry & Burger::HashMapShared::const_iterator::operator* ( ) const
inlinenoexcept

Get the Entry reference.


Given an iterator that's pointing to a valid object, return a reference to the Entry. This function returns the base class which the derived HashMap will up cast to the true data type.

Returns
Reference to the specific entry the iterator is pointing to.
See also
GetPtr() const

◆ operator++()

void BURGER_API Burger::HashMapShared::const_iterator::operator++ ( )
noexcept

Increment the iterator to the next valid entry.


Step the iterator to the next valid entry in the hash table. If the end of the table is reached, the index will be set to INVALID_INDEX

See also
HashMap::begin() const or HashMap::end() const

◆ operator->()

const Entry * Burger::HashMapShared::const_iterator::operator-> ( ) const
inlinenoexcept

Get the Entry pointer.


Given an iterator that's pointing to a valid object, return a pointer to the Entry. This function returns the base class which the derived HashMap will up cast to the true data type.

Returns
Pointer to the specific entry the iterator is pointing to.
See also
GetPtr() const

◆ operator==()

uint_t Burger::HashMapShared::const_iterator::operator== ( const const_iterator & it) const
inlinenoexcept

Test for equality between iterators.


If two iterators point to the same index, return TRUE

Parameters
itReference to iterator to test against this one
Returns
TRUE if the iterators match, FALSE if not.
See also
operator!=(const const_iterator&) const

Member Data Documentation

◆ m_pParent

const HashMapShared* Burger::HashMapShared::const_iterator::m_pParent
protected

Pointer to the parent class instance.

◆ m_uIndex

uintptr_t Burger::HashMapShared::const_iterator::m_uIndex
protected

Last accessed index.