FastLED 3.9.15
Loading...
Searching...
No Matches
fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT > Class Template Reference

Detailed Description

template<typename Key, typename T, typename Hash = Hash<Key>, typename KeyEqual = EqualTo<Key>, int INLINED_COUNT = FASTLED_HASHMAP_INLINED_COUNT>
class fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >

Definition at line 58 of file unordered_map.h.

#include <unordered_map.h>

+ Inheritance diagram for fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >:
+ Collaboration diagram for fl::unordered_map< Key, T, Hash, KeyEqual, INLINED_COUNT >:

Classes

struct  const_iterator
 
struct  iterator
 

Public Member Functions

 unordered_map () FL_NOEXCEPT
 
 unordered_map (const unordered_map &other) FL_NOEXCEPT
 
 unordered_map (fl::initializer_list< pair< Key, T > > init)
 
 unordered_map (fl::size initial_capacity)
 
 unordered_map (fl::size initial_capacity, float max_load)
 
 unordered_map (fl::size n, const Hash &hf, const KeyEqual &eq)
 
template<typename InputIt>
 unordered_map (InputIt first, InputIt last)
 
 unordered_map (memory_resource *resource)
 
 unordered_map (unordered_map &&other) FL_NOEXCEPT
 
T & at (const Key &key)
 
const T & at (const Key &key) const
 
iterator begin ()
 
const_iterator begin () const
 
fl::size bucket_count () const
 
fl::size capacity () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 
bool contains (const Key &key) const
 
fl::size count (const Key &key) const
 
template<typename... Args>
pair< iterator, bool > emplace (Args &&... args)
 
template<typename... Args>
iterator emplace_hint (const_iterator hint, Args &&... args)
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
pair< iterator, iteratorequal_range (const Key &key)
 
pair< const_iterator, const_iteratorequal_range (const Key &key) const
 
bool erase (const Key &key)
 
iterator erase (const_iterator first, const_iterator last)
 
iterator erase (iterator it)
 
iterator find (const Key &key)
 
const_iterator find (const Key &key) const
 
T * find_value (const Key &key)
 
const T * find_value (const Key &key) const
 
memory_resourceget_memory_resource () const
 
Hash hash_function () const
 
pair< iterator, bool > insert (const Key &key, const T &value)
 
pair< iterator, bool > insert (const pair< Key, T > &kv)
 
void insert (fl::initializer_list< pair< Key, T > > init)
 
template<typename InputIt>
void insert (InputIt first, InputIt last)
 
pair< iterator, bool > insert (Key &&key, T &&value)
 
pair< iterator, bool > insert (pair< Key, T > &&kv)
 
pair< iterator, bool > insert_or_assign (const Key &key, T &&value)
 
pair< iterator, bool > insert_or_assign (Key &&key, T &&value)
 
KeyEqual key_eq () const
 
float load_factor () const
 
float max_load_factor () const
 
void max_load_factor (float ml)
 
fl::size max_size () const
 
bool needs_rehash () const
 
bool operator!= (const unordered_map &other) const
 Inequality comparison.
 
unordered_mapoperator= (const unordered_map &other) FL_NOEXCEPT
 
unordered_mapoperator= (fl::initializer_list< pair< Key, T > > init) FL_NOEXCEPT
 
unordered_mapoperator= (unordered_map &&other) FL_NOEXCEPT
 
bool operator== (const unordered_map &other) const
 Equality comparison (map equality: same key-value pairs, order-independent)
 
T & operator[] (const Key &key)
 
void rehash (fl::size n)
 
bool remove (const Key &key)
 
void reserve (fl::size n)
 
void setLoadFactor (float f)
 
fl::size size () const
 
void swap (unordered_map &other)
 
template<typename... Args>
pair< iterator, bool > try_emplace (const Key &k, Args &&... args)
 
template<typename... Args>
pair< iterator, bool > try_emplace (Key &&k, Args &&... args)
 

Static Public Member Functions

static bool NeedsRehash (fl::size size, fl::size bucket_size, fl::size tombstones, u8 load_factor)
 

Private Types

enum  { kLinearProbingOnlySize = 8 , kQuadraticProbingTries = 8 }
 
using EntryAlign = max_align<Key, T>
 

Private Member Functions

fl::size find_index (const Key &key) const
 
pair< fl::size, bool > find_slot (const Key &key) const
 
fl::size find_unoccupied_index_using_bitset (const Key &key, const fl::bitset< 1024 > &occupied_set) const
 
struct FL_ALIGN_AS_T (EntryAlign::value) Entry
 
bool is_deleted (fl::size idx) const
 
bool is_empty (fl::size idx) const
 
bool is_occupied (fl::size idx) const
 
void mark_deleted (fl::size idx)
 
void mark_empty (fl::size idx)
 
void mark_occupied (fl::size idx)
 
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_NULL_DEREFERENCE void rehash_inline_no_resize ()
 
void rehash_internal (fl::size new_cap)
 

Static Private Member Functions

static fl::size next_power_of_two (fl::size n)
 
static fl::size npos ()
 

Private Attributes

fl::vector_inlined< Entry, INLINED_COUNT > _buckets
 
fl::bitset< 1024 > _deleted
 
KeyEqual _equal
 
Hash _hash
 
fl::bitset< 1024 > _occupied
 
fl::size _size
 
fl::size _tombstones
 
u8 mLoadFactor
 

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