|
RADLib
RADical C++ application framework
|
Open-addressed flat hash map optimized for cache-local lookups. More...
#include <RADDataStructures.h>
Classes | |
| class | const_iterator |
| Const forward iterator over occupied map entries. More... | |
| class | iterator |
| Forward iterator over occupied map entries. More... | |
Public Types | |
| using | value_type = std::pair< K, V > |
| Stored key/value pair type. More... | |
Public Member Functions | |
| RADFlatHashMap () | |
| Creates an empty map with default capacity. More... | |
| RADFlatHashMap (size_t capacity) | |
| Creates an empty map with at least capacity slots. More... | |
| RADFlatHashMap (const RADFlatHashMap &other) | |
| Copies another map. More... | |
| RADFlatHashMap & | operator= (const RADFlatHashMap &other) |
| Replaces this map with a copy of other. More... | |
| RADFlatHashMap (RADFlatHashMap &&other) noexcept | |
| Moves another map without rehashing. More... | |
| RADFlatHashMap & | operator= (RADFlatHashMap &&other) noexcept |
| Replaces this map by taking other's storage. More... | |
| ~RADFlatHashMap () | |
| Destroys entries and releases storage. More... | |
| iterator | begin () noexcept |
| Returns iterator to first occupied entry. More... | |
| iterator | end () noexcept |
| Returns iterator one past the entry table. More... | |
| const_iterator | begin () const noexcept |
| Returns const iterator to first occupied entry. More... | |
| const_iterator | end () const noexcept |
| Returns const iterator one past the entry table. More... | |
| bool | empty () const noexcept |
| Returns true when the map contains no entries. More... | |
| size_t | size () const noexcept |
| Returns number of occupied entries. More... | |
| size_t | capacity () const noexcept |
| Returns current hash table capacity. More... | |
| void | clear () noexcept |
| Removes all entries while keeping table storage. More... | |
| bool | contains (const K &key) const |
| Returns true when key exists. More... | |
| V * | find (const K &key) |
| Returns pointer to mapped value for key, or nullptr when absent. More... | |
| const V * | find (const K &key) const |
| Returns const pointer to mapped value for key, or nullptr when absent. More... | |
| std::pair< iterator, bool > | insert (const K &key, const V &value) |
| Inserts or replaces key with value. More... | |
| template<typename KeyArg , typename ValueArg > | |
| std::pair< iterator, bool > | emplace (KeyArg &&key, ValueArg &&value) |
| Inserts or replaces key/value with forwarding support. More... | |
| V & | operator[] (const K &key) |
| Returns mapped value for key, inserting a default value if absent. More... | |
| bool | erase (const K &key) |
| Erases key and returns true when an entry was removed. More... | |
| void | reserve (size_t desired) |
| Reserves enough capacity for desired entries. More... | |
Open-addressed flat hash map optimized for cache-local lookups.
| using RADData::RADFlatHashMap< K, V, Hash, Eq >::value_type = std::pair<K, V> |
Stored key/value pair type.
|
inline |
Creates an empty map with default capacity.
|
inlineexplicit |
Creates an empty map with at least capacity slots.
|
inline |
Copies another map.
|
inlinenoexcept |
Moves another map without rehashing.
|
inline |
Destroys entries and releases storage.
|
inlinenoexcept |
Returns const iterator to first occupied entry.
|
inlinenoexcept |
Returns iterator to first occupied entry.
|
inlinenoexcept |
Returns current hash table capacity.
|
inlinenoexcept |
Removes all entries while keeping table storage.
|
inline |
Returns true when key exists.
|
inline |
Inserts or replaces key/value with forwarding support.
|
inlinenoexcept |
Returns true when the map contains no entries.
|
inlinenoexcept |
Returns const iterator one past the entry table.
|
inlinenoexcept |
Returns iterator one past the entry table.
|
inline |
Erases key and returns true when an entry was removed.
|
inline |
Returns pointer to mapped value for key, or nullptr when absent.
|
inline |
Returns const pointer to mapped value for key, or nullptr when absent.
|
inline |
Inserts or replaces key with value.
|
inline |
Replaces this map with a copy of other.
|
inlinenoexcept |
Replaces this map by taking other's storage.
|
inline |
Returns mapped value for key, inserting a default value if absent.
|
inline |
Reserves enough capacity for desired entries.
|
inlinenoexcept |
Returns number of occupied entries.