ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
Public Methods | Protected Fields | Private Types | List of all members
HashTableBase< T, TStored, TKey, TIfMapped, THash, TEqual, TAccess, THashCaching, TRecycling >::TLocalIterator< TConstOrMutable > Class Template Reference

Class Description

template<typename T, typename TStored, typename TKey, typename TIfMapped, typename THash, typename TEqual, typename TAccess, Caching THashCaching, typename TRecycling>
template<typename TConstOrMutable>
class aworx::lib::monomem::detail::HashTableBase< T, TStored, TKey, TIfMapped, THash, TEqual, TAccess, THashCaching, TRecycling >::TLocalIterator< TConstOrMutable >


Templated implementation of std::iterator_traits. Will be exposed by derived class's definitions LocalIterator and ConstLocalIterator.

As the name of the class indicates, this iterator satisfies the C++ standard library concept ForwardIterator .

Template Parameters
TConstOrMutableA constant or mutable version of HashTableBase::TMapped.

Definition at line 561 of file hashtablebase.inl.

Public Methods

 TLocalIterator ()
 
 TLocalIterator (const TLocalIterator &other)=default
 
 TLocalIterator (const TMutable &mutableIt)
 
 TLocalIterator (uinteger pBucketIdx, Element *pElement)
 
const TKey & Key () const
 
template<typename TEnableIf = TMapped>
 Mapped () const
 
bool operator!= (TLocalIterator other) const
 
TConstOrMutable & operator* () const
 
TLocalIteratoroperator++ ()
 
TLocalIterator operator++ (int)
 
TConstOrMutable * operator-> () const
 
TLocalIteratoroperator= (const TLocalIterator &other)=default
 
bool operator== (TLocalIterator other) const
 
TConstOrMutable & Value () const
 

Protected Fields

uinteger bucketIdx
 
Elementelement
 

Private Types

using difference_type = integer
 Implementation of std::iterator_traits.
 
using iterator_category = std::forward_iterator_tag
 Implementation of std::iterator_traits.
 
using pointer = TConstOrMutable *
 Implementation of std::iterator_traits.
 
using reference = TConstOrMutable &
 Implementation of std::iterator_traits.
 
using value_type = TConstOrMutable
 Implementation of std::iterator_traits.
 

Constructor & Destructor Documentation

◆ TLocalIterator() [1/4]

TLocalIterator ( )
inline

Default constructor.

Definition at line 583 of file hashtablebase.inl.

◆ TLocalIterator() [2/4]

TLocalIterator ( const TLocalIterator< TConstOrMutable > &  other)
default

Copy constructor (default).

Parameters
otherThe iterator to assign from.

◆ TLocalIterator() [3/4]

TLocalIterator ( const TMutable &  mutableIt)

Copy constructor accepting a mutable iterator. Available only for the constant version of this iterator.

Template Parameters
TMutableThe type of this constructor's argument.
Parameters
mutableItMutable iterator to copy from.

◆ TLocalIterator() [4/4]

TLocalIterator ( uinteger  pBucketIdx,
Element pElement 
)
inlineexplicit

Constructor.

Parameters
pBucketIdxIndex of the bucket this iterator works on.
pElementPointer to current element.

Definition at line 609 of file hashtablebase.inl.

Member Function Documentation

◆ Key()

const TKey& Key ( ) const
inline

Retrieves the key-portion of the stored object that this iterator references.

Returns
A reference to the key-portion of the stored object.

Definition at line 685 of file hashtablebase.inl.

Here is the call graph for this function:

◆ Mapped()

Mapped ( ) const
inline

Retrieves the stored object that this iterator references.
This method is an alias to operator*

Availability

This method is only available with hash map mode.

Returns
A reference to the mapped-portion of the stored object.

Definition at line 701 of file hashtablebase.inl.

Here is the call graph for this function:

◆ operator!=()

bool operator!= ( TLocalIterator< TConstOrMutable >  other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and given iterator are not equal, false otherwise.

Definition at line 652 of file hashtablebase.inl.

◆ operator*()

TConstOrMutable& operator* ( ) const
inline

Retrieves the stored object that this iterator references.

Returns
A reference to the stored object.

Definition at line 661 of file hashtablebase.inl.

◆ operator++() [1/2]

TLocalIterator& operator++ ( )
inline

Prefix increment operator.

Returns
A reference to this object.

Definition at line 623 of file hashtablebase.inl.

◆ operator++() [2/2]

TLocalIterator operator++ ( int  )
inline

Postfix increment operator.

Returns
An iterator value that is not increased, yet.

Definition at line 632 of file hashtablebase.inl.

Here is the call graph for this function:

◆ operator->()

TConstOrMutable* operator-> ( ) const
inline

Retrieves a pointer to the stored object that this iterator references.

Returns
A pointer to the stored object.

Definition at line 669 of file hashtablebase.inl.

◆ operator=()

TLocalIterator& operator= ( const TLocalIterator< TConstOrMutable > &  other)
default

Copy assignment (default).

Parameters
otherThe iterator to assign from.
Returns
A reference to this object.

◆ operator==()

bool operator== ( TLocalIterator< TConstOrMutable >  other) const
inline

Comparison operator.

Parameters
otherThe iterator to compare ourselves to.
Returns
true if this and the given iterator are pointing to the same element, false otherwise.

Definition at line 643 of file hashtablebase.inl.

◆ Value()

TConstOrMutable& Value ( ) const
inline

Retrieves the stored object that this iterator references.

Returns
A reference to the stored object.

Definition at line 677 of file hashtablebase.inl.

Member Data Documentation

◆ bucketIdx

uinteger bucketIdx
protected

The index of the bucket that this iterator works on.

Definition at line 579 of file hashtablebase.inl.

◆ element

Element* element
protected

The pointer to the actual element.

Definition at line 576 of file hashtablebase.inl.


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