koutil
Loading...
Searching...
No Matches
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const > Class Template Reference

Iterator class template for hash_array. More...

Public Types

using value_type = KeyID
 
using reference = std::conditional_t<is_const, const value_type&, value_type&>
 
using constant_reference = const value_type&
 
using iterator_tag = std::forward_iterator_tag
 
using difference_type = std::ptrdiff_t
 

Public Member Functions

 iterator ()
 Default constructor.
 
 iterator (ref_t bucket, std::size_t bucket_item, ref_t bucket_end)
 Constructor with parameters.
 
 iterator (iterator &&)=default
 
 iterator (const iterator &)=default
 
iteratoroperator= (iterator &&)=default
 
iteratoroperator= (const iterator &)=default
 
 operator iterator< true > () const
 Conversion operator to constant iterator.
 
bool operator== (const iterator &other) const
 
reference operator* ()
 
constant_reference operator* () const
 
iteratoroperator++ ()
 
iterator operator++ (int)
 

Private Types

using ref_t = std::conditional_t<is_const, const bucket_t*, bucket_t*>
 

Private Member Functions

void increment ()
 Helper function to increment the iterator.
 
void find_non_empty ()
 

Private Attributes

ref_t m_ref
 
std::size_t m_item
 
ref_t m_bucket_end = nullptr
 

Detailed Description

template<typename Key, typename KeyID, typename ComptimeData, is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
class koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >

Iterator class template for hash_array.

Template Parameters
is_constBoolean indicating if the iterator is constant.

Member Typedef Documentation

◆ constant_reference

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::constant_reference = const value_type&

◆ difference_type

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::difference_type = std::ptrdiff_t

◆ iterator_tag

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::iterator_tag = std::forward_iterator_tag

◆ ref_t

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::ref_t = std::conditional_t<is_const, const bucket_t*, bucket_t*>
private

◆ reference

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::reference = std::conditional_t<is_const, const value_type&, value_type&>

◆ value_type

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::value_type = KeyID

Constructor & Destructor Documentation

◆ iterator() [1/4]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::iterator ( )
inline

Default constructor.

◆ iterator() [2/4]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::iterator ( ref_t bucket,
std::size_t bucket_item,
ref_t bucket_end )
inline

Constructor with parameters.

Parameters
bucketPointer to the current bucket.
bucket_itemIndex of the current item in the bucket.
bucket_endPointer to the end of the buckets.

◆ iterator() [3/4]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::iterator ( iterator< is_const > && )
default

◆ iterator() [4/4]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::iterator ( const iterator< is_const > & )
default

Member Function Documentation

◆ find_non_empty()

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::find_non_empty ( )
inlineprivate

◆ increment()

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::increment ( )
inlineprivate

Helper function to increment the iterator.

◆ operator iterator< true >()

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::operator iterator< true > ( ) const
inline

Conversion operator to constant iterator.

Returns
iterator<true> Constant iterator.

◆ operator*() [1/2]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
reference koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::operator* ( )
inline

◆ operator*() [2/2]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
constant_reference koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::operator* ( ) const
inline

◆ operator++() [1/2]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
iterator & koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::operator++ ( )
inline

◆ operator++() [2/2]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
iterator koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::operator++ ( int )
inline

◆ operator=() [1/2]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
iterator & koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::operator= ( const iterator< is_const > & )
default

◆ operator=() [2/2]

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
iterator & koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::operator= ( iterator< is_const > && )
default

◆ operator==()

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
bool koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::operator== ( const iterator< is_const > & other) const
inline

Member Data Documentation

◆ m_bucket_end

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
ref_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::m_bucket_end = nullptr
private

◆ m_item

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
std::size_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::m_item
private

◆ m_ref

template<typename Key , typename KeyID , typename ComptimeData , is_template_key_adapter< Key, KeyID, ComptimeData > KeyAdapter, is_template_hash< Key, ComptimeData > Hash, is_bucket< KeyID > Bucket = std::vector<std::pair<std::size_t, KeyID>>, is_allocator< Bucket > Allocator = std::allocator<Bucket>>
template<bool is_const>
ref_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator< is_const >::m_ref
private

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