ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
HashTableBase< T, TStored, TKey, TIfMapped, THash, TEqual, TAccess, THashCaching, TRecycling >::TIterator< TConstOrMutable > Class Template Reference

Description:

template<typename T, typename TStored, typename TKey, typename TIfMapped, typename THash, typename TEqual, typename TAccess, lang::Caching THashCaching, typename TRecycling>
template<typename TConstOrMutable>
class alib::monomem::detail::HashTableBase< T, TStored, TKey, TIfMapped, THash, TEqual, TAccess, THashCaching, TRecycling >::TIterator< TConstOrMutable >

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

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

Template Parameters
TConstOrMutableA constant or mutable version of the parent's template type TMapped .

Definition at line 335 of file hashtablebase.inl.

Public Method Index:

 TIterator ()=default
 
 TIterator (const TIterator &other)=default
 
 TIterator (const TMutable &mutableIt)
 
const TKey & Key () const
 
template<typename TEnableIf = TMapped>
 Mapped () const
 
bool operator!= (TIterator other) const
 
TConstOrMutable & operator* () const
 
TIteratoroperator++ ()
 
TIterator operator++ (int)
 
TConstOrMutable * operator-> () const
 
TIteratoroperator= (const TIterator &other)=default
 
bool operator== (TIterator other) const
 
TConstOrMutable & Value () const
 

Type Definition Details:

◆ difference_type

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
using difference_type = integer
private

Implementation of std::iterator_traits.

Definition at line 347 of file hashtablebase.inl.

◆ iterator_category

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
using iterator_category = std::forward_iterator_tag
private

Implementation of std::iterator_traits.

Definition at line 345 of file hashtablebase.inl.

◆ pointer

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
using pointer = TConstOrMutable*
private

Implementation of std::iterator_traits.

Definition at line 348 of file hashtablebase.inl.

◆ reference

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
using reference = TConstOrMutable&
private

Implementation of std::iterator_traits.

Definition at line 349 of file hashtablebase.inl.

◆ THashtable

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
using THashtable
private
Initial value:
const HashTableBase )
#define ATMP_IF_T_F( Cond, T, F)
Definition tmp.hpp:54
#define ATMP_IS_CONST(T)
Definition tmp.hpp:25
HashTableBase(MonoAllocator *pAllocator, float pBaseLoadFactor, float pMaxLoadFactor)

Const or mutable version of HashTableBase.

Definition at line 343 of file hashtablebase.inl.

◆ value_type

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
using value_type = TMapped
private

Implementation of std::iterator_traits.

Definition at line 346 of file hashtablebase.inl.

Field Details:

◆ bucketIdx

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
uinteger bucketIdx
protected

The actual bucket index.

Definition at line 356 of file hashtablebase.inl.

◆ element

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
Element* element
protected

The pointer to the actual element.

Definition at line 359 of file hashtablebase.inl.

◆ table

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
THashtable* table
protected

The pointer to the hash table.

Definition at line 353 of file hashtablebase.inl.

Constructor(s) / Destructor Details::

◆ TIterator() [1/5]

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TIterator ( THashtable * pTable,
uinteger pBbucketIx )
inlineprotected

Internal constructor. Searches the first element, starting with given bucket number.

Parameters
pTablePointer to the hash table.
pBbucketIxThe bucket index.

Definition at line 367 of file hashtablebase.inl.

◆ TIterator() [2/5]

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TIterator ( THashtable * pTable,
uinteger pBbucketIx,
Element * pElement )
inlineprotected

Internal constructor creating a specific iterator.

Parameters
pTablePointer to the hash table.
pBbucketIxThe bucket index.
pElementPointer to the current element.

Definition at line 391 of file hashtablebase.inl.

◆ TIterator() [3/5]

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TIterator ( )
default

Default constructor. Keeps everything uninitialized.

◆ TIterator() [4/5]

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TIterator ( const TIterator< TConstOrMutable > & other)
default

Copy constructor (default).

Parameters
otherThe iterator to assign from.

◆ TIterator() [5/5]

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TIterator ( 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.

Method Details:

◆ Key()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
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 524 of file hashtablebase.inl.

Here is the call graph for this function:

◆ Mapped()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
template<typename TEnableIf = TMapped>
Mapped ( ) const
inline

Retrieves the mapped-portion of 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 540 of file hashtablebase.inl.

Here is the call graph for this function:

◆ operator!=()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
bool operator!= ( TIterator< 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 490 of file hashtablebase.inl.

◆ operator*()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TConstOrMutable & operator* ( ) const
inline

Retrieves the stored object that this iterator references.

Returns
A reference to the stored object.

Definition at line 500 of file hashtablebase.inl.

◆ operator++() [1/2]

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TIterator & operator++ ( )
inline

Prefix increment operator.

Returns
A reference to this object.

Definition at line 446 of file hashtablebase.inl.

◆ operator++() [2/2]

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TIterator operator++ ( int )
inline

Postfix increment operator.

Returns
An iterator value that is not increased, yet.

Definition at line 471 of file hashtablebase.inl.

Here is the call graph for this function:

◆ operator->()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
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 508 of file hashtablebase.inl.

◆ operator=()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TIterator & operator= ( const TIterator< TConstOrMutable > & other)
default

Copy assignment (default).

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

◆ operator==()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
bool operator== ( TIterator< 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 482 of file hashtablebase.inl.

◆ repair()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
void repair ( )
inlineprotected

Moves an iterator with a nulled element pointer to the next element.

Definition at line 398 of file hashtablebase.inl.

◆ Value()

template<typename T , typename TStored , typename TKey , typename TIfMapped , typename THash , typename TEqual , typename TAccess , lang::Caching THashCaching, typename TRecycling >
template<typename TConstOrMutable >
TConstOrMutable & Value ( ) const
inline

Retrieves the stored object that this iterator references.

Returns
A reference to the stored object.

Definition at line 516 of file hashtablebase.inl.


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