array-hash
|
#include <array_hash.h>
Inherits tsl::detail_array_hash::value_container< T >, Hash, and GrowthPolicy.
Classes | |
class | array_hash_iterator |
Public Types | |
using | char_type = CharT |
using | key_size_type = KeySizeT |
using | index_size_type = IndexSizeT |
using | size_type = std::size_t |
using | hasher = Hash |
using | key_equal = KeyEqual |
using | iterator = array_hash_iterator< false > |
using | const_iterator = array_hash_iterator< true > |
Public Member Functions | |
array_hash (size_type bucket_count, const Hash &hash, float max_load_factor) | |
array_hash (const array_hash &other) | |
array_hash (array_hash &&other) noexcept(std::is_nothrow_move_constructible< value_container< T >>::value &&std::is_nothrow_move_constructible< Hash >::value &&std::is_nothrow_move_constructible< GrowthPolicy >::value &&std::is_nothrow_move_constructible< std::vector< array_bucket >>::value) | |
array_hash & | operator= (const array_hash &other) |
array_hash & | operator= (array_hash &&other) |
iterator | begin () noexcept |
const_iterator | begin () const noexcept |
const_iterator | cbegin () const noexcept |
iterator | end () noexcept |
const_iterator | end () const noexcept |
const_iterator | cend () const noexcept |
bool | empty () const noexcept |
size_type | size () const noexcept |
size_type | max_size () const noexcept |
size_type | max_key_size () const noexcept |
void | shrink_to_fit () |
void | clear () noexcept |
template<class... ValueArgs> | |
std::pair< iterator, bool > | emplace (const CharT *key, size_type key_size, ValueArgs &&... value_args) |
template<class M > | |
std::pair< iterator, bool > | insert_or_assign (const CharT *key, size_type key_size, M &&obj) |
iterator | erase (const_iterator pos) |
iterator | erase (const_iterator first, const_iterator last) |
size_type | erase (const CharT *key, size_type key_size) |
size_type | erase (const CharT *key, size_type key_size, std::size_t hash) |
void | swap (array_hash &other) |
template<class U = T, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> | |
U & | at (const CharT *key, size_type key_size) |
template<class U = T, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> | |
const U & | at (const CharT *key, size_type key_size) const |
template<class U = T, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> | |
U & | at (const CharT *key, size_type key_size, std::size_t hash) |
template<class U = T, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> | |
const U & | at (const CharT *key, size_type key_size, std::size_t hash) const |
template<class U = T, typename std::enable_if< has_mapped_type< U >::value >::type * = nullptr> | |
U & | access_operator (const CharT *key, size_type key_size) |
size_type | count (const CharT *key, size_type key_size) const |
size_type | count (const CharT *key, size_type key_size, std::size_t hash) const |
iterator | find (const CharT *key, size_type key_size) |
const_iterator | find (const CharT *key, size_type key_size) const |
iterator | find (const CharT *key, size_type key_size, std::size_t hash) |
const_iterator | find (const CharT *key, size_type key_size, std::size_t hash) const |
std::pair< iterator, iterator > | equal_range (const CharT *key, size_type key_size) |
std::pair< const_iterator, const_iterator > | equal_range (const CharT *key, size_type key_size) const |
std::pair< iterator, iterator > | equal_range (const CharT *key, size_type key_size, std::size_t hash) |
std::pair< const_iterator, const_iterator > | equal_range (const CharT *key, size_type key_size, std::size_t hash) const |
size_type | bucket_count () const |
size_type | max_bucket_count () const |
float | load_factor () const |
float | max_load_factor () const |
void | max_load_factor (float ml) |
void | rehash (size_type count) |
void | reserve (size_type count) |
hasher | hash_function () const |
key_equal | key_eq () const |
iterator | mutable_iterator (const_iterator it) noexcept |
template<class Serializer > | |
void | serialize (Serializer &serializer) const |
template<class Deserializer > | |
void | deserialize (Deserializer &deserializer, bool hash_compatible) |
Static Public Attributes | |
static const size_type | DEFAULT_INIT_BUCKET_COUNT = 16 |
static constexpr float | DEFAULT_MAX_LOAD_FACTOR = 2.0f |
static const size_type | MAX_KEY_SIZE = array_bucket::MAX_KEY_SIZE |
If there is no value in the array_hash (in the case of a set for example), T should be void.
The size of a key string is limited to std::numeric_limits<KeySizeT>::max() - 1.
The number of elements in the map is limited to std::numeric_limits<IndexSizeT>::max().
using tsl::detail_array_hash::array_hash< CharT, T, Hash, KeyEqual, StoreNullTerminator, KeySizeT, IndexSizeT, GrowthPolicy >::char_type = CharT |
using tsl::detail_array_hash::array_hash< CharT, T, Hash, KeyEqual, StoreNullTerminator, KeySizeT, IndexSizeT, GrowthPolicy >::const_iterator = array_hash_iterator<true> |
using tsl::detail_array_hash::array_hash< CharT, T, Hash, KeyEqual, StoreNullTerminator, KeySizeT, IndexSizeT, GrowthPolicy >::hasher = Hash |
using tsl::detail_array_hash::array_hash< CharT, T, Hash, KeyEqual, StoreNullTerminator, KeySizeT, IndexSizeT, GrowthPolicy >::index_size_type = IndexSizeT |
using tsl::detail_array_hash::array_hash< CharT, T, Hash, KeyEqual, StoreNullTerminator, KeySizeT, IndexSizeT, GrowthPolicy >::iterator = array_hash_iterator<false> |
using tsl::detail_array_hash::array_hash< CharT, T, Hash, KeyEqual, StoreNullTerminator, KeySizeT, IndexSizeT, GrowthPolicy >::key_equal = KeyEqual |
using tsl::detail_array_hash::array_hash< CharT, T, Hash, KeyEqual, StoreNullTerminator, KeySizeT, IndexSizeT, GrowthPolicy >::key_size_type = KeySizeT |
using tsl::detail_array_hash::array_hash< CharT, T, Hash, KeyEqual, StoreNullTerminator, KeySizeT, IndexSizeT, GrowthPolicy >::size_type = std::size_t |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
When erasing an element from a bucket with erase_from_bucket, it invalidates all the iterators in the array bucket of the element (m_array_bucket_iterator) but not the iterators of the buckets itself (m_buckets_iterator).
So first erase all the values between first and last which are not part of the bucket of last, and then erase carefully the values in last's bucket.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inline |
|
static |
|
static |
|
static |