[#BloombergLP-bdlc-FlatHashTable] = xref:BloombergLP.adoc[BloombergLP]::xref:BloombergLP/bdlc.adoc[bdlc]::FlatHashTable :relfileprefix: ../../ :mrdocs: This class template provides a flat hash table implementation useful for implementing a flat hash set and flat hash map. == Synopsis Declared in `<bdlc_flathashtable.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template< class KEY, class ENTRY, class ENTRY_UTIL, class HASH, class EQUAL> class FlatHashTable; ---- == Type Aliases [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/FlatHashTable/const_iterator.adoc[`const_iterator`] | Iterator providing non‐modifiable access to entries. | xref:BloombergLP/bdlc/FlatHashTable/entry_type.adoc[`entry_type`] | Entry type stored by this table. | xref:BloombergLP/bdlc/FlatHashTable/entry_util_type.adoc[`entry_util_type`] | Utility type for constructing entries and extracting keys. | xref:BloombergLP/bdlc/FlatHashTable/hash_type.adoc[`hash_type`] | Hash functor type. | xref:BloombergLP/bdlc/FlatHashTable/iterator.adoc[`iterator`] | Iterator providing modifiable access to entries. | xref:BloombergLP/bdlc/FlatHashTable/key_equal_type.adoc[`key_equal_type`] | Key equality predicate type. | xref:BloombergLP/bdlc/FlatHashTable/key_type.adoc[`key_type`] | Key type used by this table. |=== == Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/FlatHashTable/2constructor-0f.adoc[`FlatHashTable`] [.small]#[constructor]# | Constructors | xref:BloombergLP/bdlc/FlatHashTable/2destructor.adoc[`~FlatHashTable`] [.small]#[destructor]# | Destroy this object and each of its entries. | xref:BloombergLP/bdlc/FlatHashTable/operator_assign-00.adoc[`operator=`] | Assignment operators | xref:BloombergLP/bdlc/FlatHashTable/allocator.adoc[`allocator`] | Return the allocator used by this hash table to supply memory. | xref:BloombergLP/bdlc/FlatHashTable/begin-05.adoc[`begin`] | Return an iterator representing the beginning of the sequence of entries held by this container. | xref:BloombergLP/bdlc/FlatHashTable/capacity.adoc[`capacity`] | Return the number of elements this table could hold if the load factor were 1. | xref:BloombergLP/bdlc/FlatHashTable/cbegin.adoc[`cbegin`] | Return an iterator representing the beginning of the sequence of entries held by this container. | xref:BloombergLP/bdlc/FlatHashTable/cend.adoc[`cend`] | Return an iterator representing one past the end of the sequence of entries held by this container. | xref:BloombergLP/bdlc/FlatHashTable/clear.adoc[`clear`] | Remove all entries from this table. | xref:BloombergLP/bdlc/FlatHashTable/contains.adoc[`contains`] | Return `true` if this table contains an entry having the specified `key`, and `false` otherwise. | xref:BloombergLP/bdlc/FlatHashTable/controls.adoc[`controls`] | Return the address of the underlying control array, or 0. | xref:BloombergLP/bdlc/FlatHashTable/count.adoc[`count`] | Return the number of objects in this table having the specified `key`. | xref:BloombergLP/bdlc/FlatHashTable/emplace.adoc[`emplace`] | Emplace an `ENTRY` constructed from `args` into this table. | xref:BloombergLP/bdlc/FlatHashTable/empty.adoc[`empty`] | Return `true` if this table contains no entries, and `false` otherwise. | xref:BloombergLP/bdlc/FlatHashTable/end-07.adoc[`end`] | Return an iterator representing one past the end of the sequence of entries held by this container. | xref:BloombergLP/bdlc/FlatHashTable/entries.adoc[`entries`] | Return the address of the underlying entries array, or 0. | xref:BloombergLP/bdlc/FlatHashTable/equal_range-07.adoc[`equal_range`] | `equal_range` overloads | xref:BloombergLP/bdlc/FlatHashTable/erase-03.adoc[`erase`] | `erase` overloads | xref:BloombergLP/bdlc/FlatHashTable/find-082.adoc[`find`] | `find` overloads | xref:BloombergLP/bdlc/FlatHashTable/hash_function.adoc[`hash_function`] | Return (a copy of) the unary hash functor used by this flat hash table to generate a hash value (of type `bsl::size_t) for a `KEY' object. | xref:BloombergLP/bdlc/FlatHashTable/insert-0e.adoc[`insert`] | `insert` overloads | xref:BloombergLP/bdlc/FlatHashTable/insertTransparent.adoc[`insertTransparent`] | Insert an entry for `key` if no equivalent key is already present. | xref:BloombergLP/bdlc/FlatHashTable/key_eq.adoc[`key_eq`] | Return (a copy of) the binary key‐equality functor used by this flat hash table that returns `true` if two `KEY` objects are equal, and `false` otherwise. | xref:BloombergLP/bdlc/FlatHashTable/load_factor.adoc[`load_factor`] | Return the current ratio between the number of elements in this table and its capacity. | xref:BloombergLP/bdlc/FlatHashTable/max_load_factor.adoc[`max_load_factor`] | Return the maximum load factor allowed for this table. | xref:BloombergLP/bdlc/FlatHashTable/operator_subs.adoc[`operator[]`] | Return a reference to the entry for `key`, inserting one if needed. | xref:BloombergLP/bdlc/FlatHashTable/rehash.adoc[`rehash`] | Change the capacity to at least `minimumCapacity` and rehash. | xref:BloombergLP/bdlc/FlatHashTable/reserve.adoc[`reserve`] | Reserve capacity for at least the specified `numEntries`. | xref:BloombergLP/bdlc/FlatHashTable/reset.adoc[`reset`] | Remove all entries from this table and release all memory from this table, returning the table to the zero‐capacity state. | xref:BloombergLP/bdlc/FlatHashTable/size.adoc[`size`] | Return the number of entries in this table. | xref:BloombergLP/bdlc/FlatHashTable/swap.adoc[`swap`] | Efficiently exchange the value of this table with `other`. | xref:BloombergLP/bdlc/FlatHashTable/try_emplace-0b.adoc[`try_emplace`] | Insert a newly constructed entry for `key` unless an equivalent key exists. |=== == Static Data Members [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/FlatHashTable/k_HASHLET_MASK.adoc[`k_HASHLET_MASK`] | Mask used to extract the seven‐bit hashlet from a hash value. | xref:BloombergLP/bdlc/FlatHashTable/k_MAX_LOAD_FACTOR_DENOMINATOR.adoc[`k_MAX_LOAD_FACTOR_DENOMINATOR`] | Denominator of the fraction that specifies the maximum load factor. | xref:BloombergLP/bdlc/FlatHashTable/k_MAX_LOAD_FACTOR_NUMERATOR.adoc[`k_MAX_LOAD_FACTOR_NUMERATOR`] | Numerator of the fraction that specifies the maximum load factor. | xref:BloombergLP/bdlc/FlatHashTable/k_MIN_CAPACITY.adoc[`k_MIN_CAPACITY`] | Minimum non‐zero capacity of a table. |=== == Non-Member Functions [cols="1,4"] |=== | Name| Description | xref:BloombergLP/bdlc/operator_not_eq-0be.adoc[`operator!=`] | Return `true` if the specified `lhs` and `rhs` objects do not have the same value, and `false` otherwise. | xref:BloombergLP/bdlc/operator_eq-0d5.adoc[`operator==`] | Return `true` if the specified `lhs` and `rhs` objects have the same value, and `false` otherwise. | xref:BloombergLP/bdlc/swap-0b6.adoc[`swap`] | Exchange the values of the specified `a` and `b` objects. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#