#include <hash_map.hpp>
template<typename TKey, typename TValue, class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
class std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >
◆ allocator_type
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ const_iterator
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ iterator
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ key_type
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ mapped_type
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ size_type
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ value_type
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ hash_map() [1/6]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
155 : m_nodes(&ms_emptyNode), m_size(0), m_capacity(0), m_capacityMask(0), m_numUsed(0)
static const size_type kInitialCapacity
Definition: hash_map.hpp:153
◆ hash_map() [2/6]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
160 : m_nodes(&ms_emptyNode), m_size(0), m_capacity(0), m_capacityMask(0), m_numUsed(0), m_allocator(allocator)
◆ hash_map() [3/6]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
164 : m_nodes(&ms_emptyNode), m_size(0), m_capacity(0), m_capacityMask(0), m_numUsed(0), m_allocator(allocator)
void reserve(size_type min_size)
Definition: hash_map.hpp:338
◆ hash_map() [4/6]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
169 : m_nodes(&ms_emptyNode), m_size(0), m_capacity(0), m_capacityMask(0), m_numUsed(0), m_hashFunc(hashFunc), m_allocator(allocator)
void reserve(size_type min_size)
Definition: hash_map.hpp:338
◆ hash_map() [5/6]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::hash_map |
( |
const hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator > & |
rhs, |
|
|
const allocator_type & |
allocator = allocator_type() |
|
) |
| |
|
inline |
174 : m_nodes(&ms_emptyNode), m_size(0), m_capacity(0), m_capacityMask(0), m_numUsed(0), m_allocator(allocator)
◆ hash_map() [6/6]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ ~hash_map()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ begin() [1/2]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
190 it.move_to_next_occupied_node();
node_iterator< node *, value_type *, value_type & > iterator
Definition: hash_map.hpp:149
◆ begin() [2/2]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
196 it.move_to_next_occupied_node();
node_iterator< const node *, const value_type *, const value_type & > const_iterator
Definition: hash_map.hpp:150
◆ bucket_count()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
size_type std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::bucket_count |
( |
| ) |
const |
|
inline |
◆ clear()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
void std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::clear |
( |
| ) |
|
|
inline |
322 node* endNode = m_nodes + m_capacity;
323 for (node* iter = m_nodes; iter != endNode; ++iter)
327 if (iter->is_occupied())
331 iter->hash = node::kUnusedHash;
void destruct(T *mem)
Definition: algorithm.hpp:31
◆ empty()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
size_type size() const
Definition: hash_map.hpp:351
◆ end() [1/2]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
201 return iterator(m_nodes + m_capacity,
this);
node_iterator< node *, value_type *, value_type & > iterator
Definition: hash_map.hpp:149
◆ end() [2/2]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
node_iterator< const node *, const value_type *, const value_type & > const_iterator
Definition: hash_map.hpp:150
◆ erase() [1/3]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
282 node* n = lookup(key);
283 if (n != (m_nodes + m_capacity) && n->is_occupied())
◆ erase() [2/3]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
void std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::erase |
( |
iterator |
it | ) |
|
|
inline |
292 assert(it.get_map() ==
this);
296 erase_node(it.node());
size_type empty() const
Definition: hash_map.hpp:355
iterator end()
Definition: hash_map.hpp:199
◆ erase() [3/3]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
301 for (; from != to; ++from)
303 node* n = from.node();
304 if (n->is_occupied())
◆ find() [1/2]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
311 node* n = lookup(key);
node_iterator< node *, value_type *, value_type & > iterator
Definition: hash_map.hpp:149
◆ find() [2/2]
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
316 const node* n = lookup(key);
node_iterator< const node *, const value_type *, const value_type & > const_iterator
Definition: hash_map.hpp:150
◆ get_allocator()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ insert()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
260 if (m_numUsed * TLoadFactor4 >= m_capacity * 4)
264 node* n = find_for_insert(v.first, &hash);
265 if (n->is_occupied())
267 assert(hash == n->hash && m_keyEqualFunc(v.first, n->data.first));
268 return ret_type_t(
iterator(n,
this),
false);
277 return ret_type_t(
iterator(n,
this),
true);
void copy_construct(T *mem, const T &orig)
Definition: algorithm.hpp:23
node_iterator< node *, value_type *, value_type & > iterator
Definition: hash_map.hpp:149
unsigned long hash_value_t
Definition: hash.hpp:74
◆ nonempty_bucket_count()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
size_type std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::nonempty_bucket_count |
( |
| ) |
const |
|
inline |
◆ operator=()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
hash_map& std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::operator= |
( |
const hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator > & |
rhs | ) |
|
|
inline |
225 if (m_capacity < rhs.bucket_count())
228 m_nodes = allocate_nodes(rhs.bucket_count());
229 m_capacity = rhs.bucket_count();
230 m_capacityMask = m_capacity - 1;
232 rehash(m_capacity, m_nodes, rhs.m_capacity, rhs.m_nodes,
false);
234 m_numUsed = rhs.m_numUsed;
void clear()
Definition: hash_map.hpp:320
◆ operator[]()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
211 node* n = find_for_insert(key, &hash);
212 if (n == 0 || !n->is_occupied())
214 return insert_at(
value_type(key, TValue()), n, hash).first->second;
216 return n->data.second;
std::pair< TKey, TValue > value_type
Definition: hash_map.hpp:48
unsigned long hash_value_t
Definition: hash.hpp:74
◆ reserve()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
void std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::reserve |
( |
size_type |
min_size | ) |
|
|
inline |
341 while (newCapacity < min_size)
343 if (newCapacity > m_capacity)
static const size_type kInitialCapacity
Definition: hash_map.hpp:153
int size_type
Definition: hash_map.hpp:151
◆ set_allocator()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
void std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::set_allocator |
( |
const allocator_type & |
allocator | ) |
|
|
inline |
374 m_allocator = allocator;
◆ size()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
◆ swap()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
void std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::swap |
( |
hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator > & |
rhs | ) |
|
|
inline |
244 assert(m_allocator == rhs.m_allocator);
248 std::swap(m_capacityMask, rhs.m_capacityMask);
251 std::swap(m_keyEqualFunc, rhs.m_keyEqualFunc);
void swap(TAssignable &a, TAssignable &b)
Definition: algorithm.hpp:205
◆ used_memory()
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
size_type std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::used_memory |
( |
| ) |
const |
|
inline |
static const size_type kNodeSize
Definition: hash_map.hpp:152
size_type bucket_count() const
Definition: hash_map.hpp:347
◆ kInitialCapacity
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
const size_type std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::kInitialCapacity = 64 |
|
static |
◆ kNodeSize
template<typename TKey , typename TValue , class THashFunc = std::hash<TKey>, int TLoadFactor4 = 6, class TKeyEqualFunc = std::equal_to<TKey>, class TAllocator = std::allocator>
const size_type std::hash_map< TKey, TValue, THashFunc, TLoadFactor4, TKeyEqualFunc, TAllocator >::kNodeSize = sizeof(node) |
|
static |
Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei: