Lock‐free, growable hash map built on top of AtomicHashArray.
Synopsis
Declared in <folly/AtomicHashMap.h>
template<
class KeyT,
class ValueT,
class HashFcn = std::hash<KeyT>,
class EqualFcn = std::equal_to<KeyT>,
class Allocator = std::allocator<char>,
class ProbeFcn = AtomicHashArrayLinearProbeFcn,
class KeyConvertFcn = Identity>
class AtomicHashMap;
Types
Name |
Description |
Iterator template shared by the mutable and const iterators. |
Type Aliases
Name |
Description |
Configuration options forwarded to the underlying submaps. |
|
Read‐only iterator over the elements of the map. |
|
Reference to a const element. |
|
Signed integer type for iterator differences. |
|
The hash function object type. |
|
Mutable iterator over the elements of the map. |
|
The functor type converting a lookup key to a stored key. |
|
The key equality comparison type. |
|
The key type stored in the map. |
|
The mapped value type stored in the map. |
|
Pointer to an element. |
|
Reference to an element. |
|
Unsigned integer type for sizes and counts. |
|
The element type, a key/value pair. |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy the map and all of its allocated submaps. |
|
Deleted copy assignment; the map is not assignable. |
|
|
Return the total capacity, the sum of the capacities of all submaps. |
|
Wipe all keys and values from the map. |
|
Count the elements with a given key. |
|
Insert an element, constructing the value in place. |
|
Report whether the map is empty. |
|
|
|
Erase a key from the map. |
|
Find the element with the given key. |
|
|
|
Return the hash function object. |
|
Return the element stored at a given index. |
|
|
|
Return the stored index for a key, optionally inserting a default value. |
|
Return the key equality comparison object. |
|
Return the number of submaps allocated so far to implement this map. |
|
|
|
Set the thread‐cache size of the entry counter for every submap. |
|
Return the exact number of elements in the map. |
|
Return the number of insertions before all submaps reach max load factor. |
Data Members
Name |
Description |
How much to grow when we run out of capacity. |
Template Parameters
Name |
Description |
KeyT |
The key type; must be a 32‐bit or 64‐bit atomic integer type. |
ValueT |
The mapped value type. |
HashFcn |
The hash function object type. |
EqualFcn |
The key equality comparison type. |
Allocator |
The stateless allocator type. |
ProbeFcn |
The probing strategy type. |
KeyConvertFcn |
The functor converting a lookup key to a stored key. |
Created with MrDocs