Public Member Functions | Data Fields

TSHashTable< H >::Bucket Struct Reference

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?

Detailed Description

template<typename H>
struct TSHashTable< H >::Bucket

Hash bucket.

This is stored in the base array, anchoring the open chaining.

Definition at line 1054 of file Map.h.


Constructor & Destructor Documentation

template<typename H>
TSHashTable< H >::Bucket::Bucket (  )  [inline]

Default constructor - equivalent to zero filled.

Definition at line 1079 of file Map.h.


Member Function Documentation

template<typename H>
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.


Field Documentation

template<typename H>
ListHead TSHashTable< H >::Bucket::m_chain
template<typename H>
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().

template<typename H>
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().


The documentation for this struct was generated from the following file: