CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc > Class Template Reference

#include <CeresEngine/Foundation/Container/FlatHashMap.hpp>

Inheritance diagram for CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >:
CeresEngine::Hasher< T > CeresEngine::FlatHashSet< T, H, E, A >

Classes

struct  convertible_to_iterator
 
struct  templated_iterator
 

Public Types

using value_type = T
 
using size_type = size_t
 
using difference_type = std::ptrdiff_t
 
using hasher = ArgumentHash
 
using key_equal = ArgumentEqual
 
using allocator_type = EntryAlloc
 
using reference = value_type &
 
using const_reference = const value_type &
 
using pointer = value_type *
 
using const_pointer = const value_type *
 
using iterator = templated_iterator< value_type >
 
using const_iterator = templated_iterator< const value_type >
 

Public Member Functions

 SherwoodV3Table ()
 
 SherwoodV3Table (const size_type bucket_count, const ArgumentHash &hash=ArgumentHash(), const ArgumentEqual &equal=ArgumentEqual(), const ArgumentAlloc &alloc=ArgumentAlloc())
 
 SherwoodV3Table (size_type bucket_count, const ArgumentAlloc &alloc)
 
 SherwoodV3Table (size_type bucket_count, const ArgumentHash &hash, const ArgumentAlloc &alloc)
 
 SherwoodV3Table (const ArgumentAlloc &alloc)
 
template<typename It >
 SherwoodV3Table (It first, It last, size_type bucket_count=0, const ArgumentHash &hash=ArgumentHash(), const ArgumentEqual &equal=ArgumentEqual(), const ArgumentAlloc &alloc=ArgumentAlloc())
 
template<typename It >
 SherwoodV3Table (It first, It last, size_type bucket_count, const ArgumentAlloc &alloc)
 
template<typename It >
 SherwoodV3Table (It first, It last, size_type bucket_count, const ArgumentHash &hash, const ArgumentAlloc &alloc)
 
 SherwoodV3Table (std::initializer_list< T > il, size_type bucket_count=0, const ArgumentHash &hash=ArgumentHash(), const ArgumentEqual &equal=ArgumentEqual(), const ArgumentAlloc &alloc=ArgumentAlloc())
 
 SherwoodV3Table (std::initializer_list< T > il, size_type bucket_count, const ArgumentAlloc &alloc)
 
 SherwoodV3Table (std::initializer_list< T > il, size_type bucket_count, const ArgumentHash &hash, const ArgumentAlloc &alloc)
 
 SherwoodV3Table (const SherwoodV3Table &other)
 
 SherwoodV3Table (const SherwoodV3Table &other, const ArgumentAlloc &alloc)
 
 SherwoodV3Table (SherwoodV3Table &&other) noexcept
 
 SherwoodV3Table (SherwoodV3Table &&other, const ArgumentAlloc &alloc) noexcept
 
SherwoodV3Tableoperator= (const SherwoodV3Table &other)
 
SherwoodV3Tableoperator= (SherwoodV3Table &&other) noexcept
 
 ~SherwoodV3Table ()
 
const allocator_typeget_allocator () const
 
const ArgumentEqualkey_eq () const
 
const ArgumentHashhash_function () const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator cend () const
 
iterator find (const FindKey &key)
 
const_iterator find (const FindKey &key) const
 
size_t count (const FindKey &key) const
 
Pair< iterator, iteratorequal_range (const FindKey &key)
 
Pair< const_iterator, const_iteratorequal_range (const FindKey &key) const
 
template<typename Key , typename... Args>
Pair< iterator, boolemplace (Key &&key, Args &&... args)
 
Pair< iterator, boolinsert (const value_type &value)
 
Pair< iterator, boolinsert (value_type &&value)
 
template<typename... Args>
iterator emplace_hint (const_iterator, Args &&... args)
 
iterator insert (const_iterator, const value_type &value)
 
iterator insert (const_iterator, value_type &&value)
 
template<typename It >
void insert (It begin, It end)
 
void insert (std::initializer_list< value_type > il)
 
void rehash (size_t num_buckets)
 
void reserve (const size_t num_elements)
 
convertible_to_iterator erase (const_iterator to_erase)
 
iterator erase (const_iterator begin_it, const_iterator end_it)
 
size_t erase (const FindKey &key)
 
void clear ()
 
void shrink_to_fit ()
 
void swap (SherwoodV3Table &other)
 
size_t size () const
 
size_t max_size () const
 
size_t bucket_count () const
 
size_type max_bucket_count () const
 
size_t bucket (const FindKey &key) const
 
float load_factor () const
 
void max_load_factor (const float value)
 
float max_load_factor () const
 
bool empty () const
 

Private Types

using Entry = detailv3::SherwoodV3Entry< T >
 
using AllocatorTraits = std::allocator_traits< EntryAlloc >
 
using EntryPointer = typename AllocatorTraits::pointer
 
- Private Types inherited from CeresEngine::Hasher< T >
using ReflectedType = std::decay_t< T >
 The type currently being hashed.
 

Private Member Functions

size_t num_buckets_for_reserve (const size_t num_elements) const
 
void rehash_for_other_container (const SherwoodV3Table &other)
 
void swap_pointers (SherwoodV3Table &other)
 
template<typename Key , typename... Args>
Pair< iterator, boolemplace_new_key (int8_t distance_from_desired, EntryPointer current_entry, Key &&key, Args &&... args)
 
void grow ()
 
void deallocate_data (EntryPointer begin, const size_t num_slots_minus_one, const int8_t max_lookups)
 
void reset_to_empty_state ()
 
template<typename U >
size_t hash_object (const U &key)
 
template<typename U >
size_t hash_object (const U &key) const
 
template<typename L , typename R >
bool compares_equal (const L &lhs, const R &rhs)
 
- Private Member Functions inherited from CeresEngine::Hasher< T >
constexpr Hasher (T &object, const size_t hash=0) noexcept
 Creates a new hasher for the given object.
 
template<auto P>
constexpr void data (StringView) noexcept
 Combines the hash with the.
 
template<auto P>
constexpr void func (StringView) noexcept
 No-op.
 

Static Private Member Functions

static int8_t compute_max_lookups (const size_t num_buckets)
 

Private Attributes

EntryPointer entries = Entry::empty_default_table()
 
size_t num_slots_minus_one = 0
 
HashPolicySelector< ArgumentHash >::type hash_policy
 
int8_t max_lookups = detailv3::min_lookups - 1
 
float _max_load_factor = 0.5f
 
size_t num_elements = 0
 
- Private Attributes inherited from CeresEngine::Hasher< T >
Tobject
 The object currently being hashed.
 
size_t hash
 The computed hash.
 

Member Typedef Documentation

◆ allocator_type

◆ AllocatorTraits

◆ const_iterator

◆ const_pointer

◆ const_reference

◆ difference_type

◆ Entry

◆ EntryPointer

◆ hasher

◆ iterator

◆ key_equal

◆ pointer

◆ reference

◆ size_type

◆ value_type

Constructor & Destructor Documentation

◆ SherwoodV3Table() [1/15]

◆ SherwoodV3Table() [2/15]

◆ SherwoodV3Table() [3/15]

◆ SherwoodV3Table() [4/15]

◆ SherwoodV3Table() [5/15]

◆ SherwoodV3Table() [6/15]

◆ SherwoodV3Table() [7/15]

template<typename It >
CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::SherwoodV3Table ( It  first,
It  last,
size_type  bucket_count,
const ArgumentAlloc alloc 
)
inline

◆ SherwoodV3Table() [8/15]

template<typename It >
CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::SherwoodV3Table ( It  first,
It  last,
size_type  bucket_count,
const ArgumentHash hash,
const ArgumentAlloc alloc 
)
inline

◆ SherwoodV3Table() [9/15]

CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::SherwoodV3Table ( std::initializer_list< T il,
size_type  bucket_count = 0,
const ArgumentHash hash = ArgumentHash(),
const ArgumentEqual equal = ArgumentEqual(),
const ArgumentAlloc alloc = ArgumentAlloc() 
)
inline

◆ SherwoodV3Table() [10/15]

CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::SherwoodV3Table ( std::initializer_list< T il,
size_type  bucket_count,
const ArgumentAlloc alloc 
)
inline

◆ SherwoodV3Table() [11/15]

CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::SherwoodV3Table ( std::initializer_list< T il,
size_type  bucket_count,
const ArgumentHash hash,
const ArgumentAlloc alloc 
)
inline

◆ SherwoodV3Table() [12/15]

◆ SherwoodV3Table() [13/15]

◆ SherwoodV3Table() [14/15]

◆ SherwoodV3Table() [15/15]

◆ ~SherwoodV3Table()

Member Function Documentation

◆ begin() [1/2]

◆ begin() [2/2]

◆ bucket()

◆ bucket_count()

◆ cbegin()

◆ cend()

◆ clear()

◆ compares_equal()

◆ compute_max_lookups()

◆ count()

◆ deallocate_data()

void CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::deallocate_data ( EntryPointer  begin,
const size_t  num_slots_minus_one,
const int8_t  max_lookups 
)
inlineprivate

◆ emplace()

template<typename Key , typename... Args>
Pair< iterator, bool > CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::emplace ( Key &&  key,
Args &&...  args 
)
inline

◆ emplace_hint()

template<typename... Args>
iterator CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::emplace_hint ( const_iterator  ,
Args &&...  args 
)
inline

◆ emplace_new_key()

template<typename Key , typename... Args>
Pair< iterator, bool > CeresEngine::detailv3::SherwoodV3Table< T, FindKey, ArgumentHash, Hasher, ArgumentEqual, Equal, ArgumentAlloc, EntryAlloc >::emplace_new_key ( int8_t  distance_from_desired,
EntryPointer  current_entry,
Key &&  key,
Args &&...  args 
)
inlineprivate

◆ empty()

◆ end() [1/2]

◆ end() [2/2]

◆ equal_range() [1/2]

◆ equal_range() [2/2]

◆ erase() [1/3]

◆ erase() [2/3]

◆ erase() [3/3]

◆ find() [1/2]

◆ find() [2/2]

◆ get_allocator()

◆ grow()

◆ hash_function()

◆ hash_object() [1/2]

◆ hash_object() [2/2]

◆ insert() [1/6]

◆ insert() [2/6]

◆ insert() [3/6]

◆ insert() [4/6]

◆ insert() [5/6]

◆ insert() [6/6]

◆ key_eq()

◆ load_factor()

◆ max_bucket_count()

◆ max_load_factor() [1/2]

◆ max_load_factor() [2/2]

◆ max_size()

◆ num_buckets_for_reserve()

◆ operator=() [1/2]

◆ operator=() [2/2]

◆ rehash()

◆ rehash_for_other_container()

◆ reserve()

◆ reset_to_empty_state()

◆ shrink_to_fit()

◆ size()

◆ swap()

◆ swap_pointers()

Member Data Documentation

◆ _max_load_factor

◆ entries

◆ hash_policy

◆ max_lookups

◆ num_elements

◆ num_slots_minus_one


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