A hash map for storing and lookup char * strings efficiently. More...
#include <CstrHashMap.h>
Public Types | |
typedef Base::iterator | iterator |
typedef Base::key_type | key_type |
typedef Base::value_type | value_type |
typedef TraitsT::key_allocator | key_allocator |
typedef std::pair< iterator, bool > | InsRet |
Public Member Functions | |
CstrHashMap () | |
Default constructor creates an empty map. More... | |
CstrHashMap (size_t n_buckets) | |
Overloaded Constructor creates an empty map with a specified number of buckets. More... | |
InsRet | insert (const char *key, const DataT &data) |
Inserts a new string/data pair in the map. More... | |
key_allocator & | key_alloc () |
Returns the key allocator; required for testing. More... | |
void | clear () |
Clears the map and deletes all elements. More... | |
Private Types | |
typedef std::unordered_map < const char *, DataT, typename TraitsT::hasher, typename TraitsT::key_equal > | Base |
Private Member Functions | |
InsRet | insert_key (const char *key, InsRet rv) |
Helper function to insert a string; if the string already exists then a duplicate of the string is created and inserted. More... | |
Private Attributes | |
key_allocator | m_alloc |
The key_allocator - i.e. More... | |
A hash map for storing and lookup char * strings efficiently.
The keys are case-independent.
Definition at line 44 of file CstrHashMap.h.
|
private |
Definition at line 49 of file CstrHashMap.h.
typedef std::pair<iterator, bool> Hypertable::CstrHashMap< DataT, TraitsT >::InsRet |
Definition at line 55 of file CstrHashMap.h.
typedef Base::iterator Hypertable::CstrHashMap< DataT, TraitsT >::iterator |
Definition at line 51 of file CstrHashMap.h.
typedef TraitsT::key_allocator Hypertable::CstrHashMap< DataT, TraitsT >::key_allocator |
Definition at line 54 of file CstrHashMap.h.
typedef Base::key_type Hypertable::CstrHashMap< DataT, TraitsT >::key_type |
Definition at line 52 of file CstrHashMap.h.
typedef Base::value_type Hypertable::CstrHashMap< DataT, TraitsT >::value_type |
Definition at line 53 of file CstrHashMap.h.
|
inline |
Default constructor creates an empty map.
Definition at line 59 of file CstrHashMap.h.
|
inline |
Overloaded Constructor creates an empty map with a specified number of buckets.
n_buckets | Number of buckets in the hash map |
Definition at line 66 of file CstrHashMap.h.
|
inline |
Clears the map and deletes all elements.
Definition at line 87 of file CstrHashMap.h.
|
inline |
Inserts a new string/data pair in the map.
Hides all insert methods in the base class.
key | The key of the key/data pair |
data | Reference to the data type of the key/data pair |
Definition at line 76 of file CstrHashMap.h.
|
inlineprivate |
Helper function to insert a string; if the string already exists then a duplicate of the string is created and inserted.
key | The inserted key of the object |
rv | The InsRet pair, which is the result of the actual insert operation. |
Definition at line 101 of file CstrHashMap.h.
|
inline |
Returns the key allocator; required for testing.
Definition at line 84 of file CstrHashMap.h.
|
private |