Hash bucket. More...
#include <Map.h>
Public Member Functions | |
LINK (Bucket, m_link) | |
Internal chain for iteration. | |
Bucket () | |
Default constructor - equivalent to zero filled. | |
Data Fields | |
ListHead | m_chain |
Chain of elements. | |
size_t | m_count |
# of elements in chain. | |
bool | m_mixed_p |
Do the values in this bucket have different keys? |
Hash bucket.
This is stored in the base array, anchoring the open chaining.
Definition at line 1054 of file Map.h.
TSHashTable< H >::Bucket::Bucket | ( | ) | [inline] |
TSHashTable< H >::Bucket::LINK | ( | Bucket | , | |
m_link | ||||
) |
Internal chain for iteration.
Iteration is tricky because it needs to skip over empty buckets and detect end of buckets. Both of these are difficult inside the iterator without excess data. So we chain the non-empty buckets and let the iterator walk that. This makes end detection easy and iteration on sparse data fast. If we make it a doubly linked list adding and removing buckets is very fast as well.
ListHead TSHashTable< H >::Bucket::m_chain |
Chain of elements.
Definition at line 1055 of file Map.h.
Referenced by TSHashTable< H >::begin(), TSHashTable< H >::expand(), TSHashTable< H >::find(), TSHashTable< H >::insert(), TSHashTable< H >::iterator::operator++(), and TSHashTable< H >::remove().
size_t TSHashTable< H >::Bucket::m_count |
# of elements in chain.
Definition at line 1056 of file Map.h.
Referenced by TSHashTable< H >::insert(), and TSHashTable< H >::remove().
bool TSHashTable< H >::Bucket::m_mixed_p |
Do the values in this bucket have different keys?
Definition at line 1076 of file Map.h.
Referenced by TSHashTable< H >::insert(), and TSHashTable< H >::remove().