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

#include <template_hash_array.h>

Classes

class  iterator
 Iterator class template for hash_array. More...
 

Public Types

using iterator_t = iterator<false>
 
using const_iterator_t = iterator<true>
 

Public Member Functions

 template_hash_array ()
 Default constructor.
 
 template_hash_array (std::size_t bucket_count)
 Constructor with bucket count.
 
 template_hash_array (const template_hash_array &other)
 Copy constructor.
 
 template_hash_array (template_hash_array &&other)
 Move constructor.
 
 ~template_hash_array ()
 Destructor.
 
template_hash_arrayoperator= (const template_hash_array &other)
 Copy assignment operator.
 
template_hash_arrayoperator= (template_hash_array &&other)
 Move assignment operator.
 
bool empty () const
 Check if the hash_array is empty.
 
std::size_t size () const
 Get the number of elements in the hash_array.
 
std::size_t bucket_count () const
 Returns the number of buckets.
 
float max_load_factor () const
 Returns the maximum load factor.
 
void set_max_load_factor (float factor)
 Sets a new maximum load factor.
 
void clear ()
 Clear all elements from the hash_array.
 
template<comptime_t Data>
bool try_insert (const key_t &key, const key_id_t &key_id, adapter_t adapter)
 Try to insert a key and key ID into the hash_array.
 
template<comptime_t Data>
bool try_set (const key_t &key, const key_id_t &new_key_id, adapter_t adapter)
 Try to set new key ID.
 
template<comptime_t Data>
void erase (const key_t &key, adapter_t adapter)
 Erases an element from the hash table.
 
template<comptime_t Data>
iterator_t find (const key_t &key, adapter_t adapter)
 Finds an element in the hash table.
 
template<comptime_t Data>
const_iterator_t find (const key_t &key, adapter_t adapter) const
 Finds an element in the hash table.
 
iterator_t begin ()
 Get an iterator to the beginning of the hash_array.
 
iterator_t end ()
 Get an iterator to the end of the hash_array.
 
const_iterator_t begin () const
 Get a constant iterator to the beginning of the hash_array.
 
const_iterator_t end () const
 Get a constant iterator to the end of the hash_array.
 
const_iterator_t cbegin () const
 Get a constant iterator to the beginning of the hash_array.
 
const_iterator_t cend () const
 Get a constant iterator to the end of the hash_array.
 

Private Types

using key_t = Key
 
using key_id_t = KeyID
 
using value_t = std::size_t
 
using bucket_t = Bucket
 
using hash_t = Hash
 
using bucket_iter = bucket_t::iterator
 
using bucket_const_iter = bucket_t::const_iterator
 
using adapter_t = KeyAdapter
 
using allocator_t = Allocator
 
using comptime_t = ComptimeData
 

Private Member Functions

template<comptime_t Data>
value_t hash_key (const Key &key)
 
template<comptime_t Data>
bucket_tget_bucket (const key_t &key)
 
template<comptime_t Data>
bucket_iter find_bucket_item (const key_t &key, bucket_t &bucket, adapter_t adapter)
 
template<comptime_t Data>
bucket_const_iter find_bucket_item (const key_t &key, const bucket_t &bucket, adapter_t adapter) const
 
template<comptime_t Data>
bool insert (const key_t &key, const key_id_t &key_id, adapter_t adapter)
 
template<comptime_t Data>
void remove (const key_t &key, adapter_t adapter)
 
template<comptime_t Data>
bool set (const key_t &key, const key_id_t &new_key_id, adapter_t adapter)
 
void rehash_if_needed ()
 
void clear_all_buckets ()
 
void destroy ()
 

Private Attributes

bucket_tm_buckets
 
std::size_t m_buckets_count
 
std::size_t m_size = 0
 
float m_max_load_factor = 1.0F
 

Member Typedef Documentation

◆ adapter_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::adapter_t = KeyAdapter
private

◆ allocator_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::allocator_t = Allocator
private

◆ bucket_const_iter

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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::bucket_const_iter = bucket_t::const_iterator
private

◆ bucket_iter

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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::bucket_iter = bucket_t::iterator
private

◆ bucket_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::bucket_t = Bucket
private

◆ comptime_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::comptime_t = ComptimeData
private

◆ const_iterator_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::const_iterator_t = iterator<true>

◆ hash_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::hash_t = Hash
private

◆ iterator_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::iterator_t = iterator<false>

◆ key_id_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::key_id_t = KeyID
private

◆ key_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::key_t = Key
private

◆ value_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>>
using koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::value_t = std::size_t
private

Constructor & Destructor Documentation

◆ template_hash_array() [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>>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::template_hash_array ( )
inline

Default constructor.

◆ template_hash_array() [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>>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::template_hash_array ( std::size_t bucket_count)
inline

Constructor with bucket count.

Parameters
bucket_countNumber of buckets.

◆ template_hash_array() [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>>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::template_hash_array ( const template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator > & other)
inline

Copy constructor.

Parameters
otherAnother hash_array to copy from.

◆ template_hash_array() [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>>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::template_hash_array ( template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator > && other)
inline

Move constructor.

Parameters
otherAnother hash_array to move from.

◆ ~template_hash_array()

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>>
koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::~template_hash_array ( )
inline

Destructor.

Member Function Documentation

◆ begin() [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>>
iterator_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::begin ( )
inline

Get an iterator to the beginning of the hash_array.

Returns
iterator_t Iterator to the beginning.

◆ begin() [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>>
const_iterator_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::begin ( ) const
inline

Get a constant iterator to the beginning of the hash_array.

Returns
const_iterator_t Constant iterator to the beginning.

◆ bucket_count()

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>>
std::size_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::bucket_count ( ) const
inlinenodiscard

Returns the number of buckets.

Returns
std::size_t Number of buckets.

◆ cbegin()

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>>
const_iterator_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::cbegin ( ) const
inline

Get a constant iterator to the beginning of the hash_array.

Returns
iterator_t Constant iterator to the beginning.

◆ cend()

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>>
const_iterator_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::cend ( ) const
inline

Get a constant iterator to the end of the hash_array.

Returns
const_iterator_t Constant iterator to the end.

◆ clear()

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>>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::clear ( )
inline

Clear all elements from the hash_array.

◆ clear_all_buckets()

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>>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::clear_all_buckets ( )
inlineprivate

◆ destroy()

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>>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::destroy ( )
inlineprivate

◆ 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>>
bool koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::empty ( ) const
inlinenodiscard

Check if the hash_array is empty.

Returns
bool True if empty, false otherwise.

◆ end() [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>>
iterator_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::end ( )
inline

Get an iterator to the end of the hash_array.

Returns
iterator_t Iterator to the end.

◆ end() [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>>
const_iterator_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::end ( ) const
inline

Get a constant iterator to the end of the hash_array.

Returns
const_iterator_t Constant iterator to the end.

◆ erase()

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<comptime_t Data>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::erase ( const key_t & key,
adapter_t adapter )
inline

Erases an element from the hash table.

Template Parameters
DataThe comptime data.
Parameters
keyKey of the element to erase.
adapterKey adapter for comparison.
Returns
true If the element was successfully erased.
false If the element was not found.

◆ find() [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<comptime_t Data>
iterator_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::find ( const key_t & key,
adapter_t adapter )
inline

Finds an element in the hash table.

Template Parameters
DataThe comptime data.
Parameters
keyKey of the element to find.
adapterKey adapter for comparison.
Returns
iterator_t The iterator with found element, if not found end() is returned.

◆ find() [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<comptime_t Data>
const_iterator_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::find ( const key_t & key,
adapter_t adapter ) const
inline

Finds an element in the hash table.

Template Parameters
DataThe comptime data.
Parameters
keyKey of the element to find.
adapterKey adapter for comparison.
Returns
const_iterator_t The iterator with found element, if not found end() is returned.

◆ find_bucket_item() [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<comptime_t Data>
bucket_iter koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::find_bucket_item ( const key_t & key,
bucket_t & bucket,
adapter_t adapter )
inlineprivate

◆ find_bucket_item() [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<comptime_t Data>
bucket_const_iter koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::find_bucket_item ( const key_t & key,
const bucket_t & bucket,
adapter_t adapter ) const
inlineprivate

◆ get_bucket()

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<comptime_t Data>
bucket_t & koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::get_bucket ( const key_t & key)
inlineprivate

◆ hash_key()

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<comptime_t Data>
value_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::hash_key ( const Key & key)
inlineprivate

◆ insert()

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<comptime_t Data>
bool koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::insert ( const key_t & key,
const key_id_t & key_id,
adapter_t adapter )
inlineprivate

◆ max_load_factor()

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>>
float koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::max_load_factor ( ) const
inlinenodiscard

Returns the maximum load factor.

Returns
float Maximum load factor.

◆ 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_hash_array & koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::operator= ( const template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator > & other)
inline

Copy assignment operator.

Parameters
otherAnother hash_array to copy from.
Returns
hash_array& Reference to the assigned hash_array.

◆ 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_hash_array & koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::operator= ( template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator > && other)
inline

Move assignment operator.

Parameters
otherAnother hash_array to move from.
Returns
hash_array& Reference to the assigned hash_array.

◆ rehash_if_needed()

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>>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::rehash_if_needed ( )
inlineprivate

◆ remove()

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<comptime_t Data>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::remove ( const key_t & key,
adapter_t adapter )
inlineprivate

◆ set()

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<comptime_t Data>
bool koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::set ( const key_t & key,
const key_id_t & new_key_id,
adapter_t adapter )
inlineprivate

◆ set_max_load_factor()

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>>
void koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::set_max_load_factor ( float factor)
inline

Sets a new maximum load factor.

Parameters
factorNew maximum load factor.

◆ size()

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>>
std::size_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::size ( ) const
inlinenodiscard

Get the number of elements in the hash_array.

Returns
std::size_t Number of elements.

◆ try_insert()

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<comptime_t Data>
bool koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::try_insert ( const key_t & key,
const key_id_t & key_id,
adapter_t adapter )
inline

Try to insert a key and key ID into the hash_array.

Template Parameters
DataThe comptime data.
Parameters
keyThe key to insert.
key_idThe key ID to insert.
Returns
bool True if the key is not inside hash_array, false otherwise.

◆ try_set()

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<comptime_t Data>
bool koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::try_set ( const key_t & key,
const key_id_t & new_key_id,
adapter_t adapter )
inline

Try to set new key ID.

Template Parameters
DataThe comptime data.
Parameters
keyThe key.
new_key_idThe new key ID.
Returns
bool True if the key ID was changed, false otherwise.

Member Data Documentation

◆ m_buckets

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>>
bucket_t* koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::m_buckets
private

◆ m_buckets_count

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>>
std::size_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::m_buckets_count
private

◆ m_max_load_factor

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>>
float koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::m_max_load_factor = 1.0F
private

◆ m_size

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>>
std::size_t koutil::container::template_hash_array< Key, KeyID, ComptimeData, KeyAdapter, Hash, Bucket, Allocator >::m_size = 0
private

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