1 #ifndef _EXT_HASH_MAP_HH_
2 #define _EXT_HASH_MAP_HH_
5 #include <ddd/google/sparse_hash_map>
7 #include <unordered_map>
31 typedef typename internal_hash_map::iterator
iterator;
33 typedef typename internal_hash_map::size_type
size_type;
42 typedef const typename std::pair<const Key, Data>
value_type;
237 std::pair<const Key, Data> value_to_insert(key,Data());
238 std::pair<iterator,bool> p(
map_.insert(value_to_insert));
247 return map_.erase(key) > 1 ? false :
true;
251 std::map<std::string, size_t> get_hits()
const {
return map_.get_hits(); }
252 std::map<std::string, size_t> get_misses()
const {
return map_.get_misses(); }
253 std::map<std::string, size_t> get_bounces()
const {
return map_.get_bounces(); }
Definition: ext_hash_map.hh:96
accessor & operator=(const accessor &)
bool has_result_
Definition: ext_hash_map.hh:103
iterator current_bucket_
Definition: ext_hash_map.hh:104
std::pair< const Key, Data > value_type
Definition: ext_hash_map.hh:99
accessor()
Definition: ext_hash_map.hh:122
void release()
Definition: ext_hash_map.hh:136
value_type & operator*() const
Definition: ext_hash_map.hh:111
accessor(const accessor &)
bool empty() const
Definition: ext_hash_map.hh:130
value_type * operator->() const
Definition: ext_hash_map.hh:117
Definition: ext_hash_map.hh:38
bool empty() const
Definition: ext_hash_map.hh:63
const_accessor(const const_accessor &)
const_accessor()
Definition: ext_hash_map.hh:55
const value_type * operator->() const
Definition: ext_hash_map.hh:75
bool has_result_
Definition: ext_hash_map.hh:48
const_iterator current_bucket_
Definition: ext_hash_map.hh:49
const_accessor & operator=(const const_accessor &)
const std::pair< const Key, Data > value_type
Definition: ext_hash_map.hh:42
const value_type & operator*() const
Definition: ext_hash_map.hh:69
void release()
Definition: ext_hash_map.hh:81
Definition: ext_hash_map.hh:21
iterator end()
Definition: ext_hash_map.hh:187
const_iterator end() const
Definition: ext_hash_map.hh:193
size_type size() const
Definition: ext_hash_map.hh:199
ext_hash_map()
Definition: ext_hash_map.hh:162
internal_hash_map::const_iterator const_iterator
Definition: ext_hash_map.hh:32
google::sparse_hash_map< Key, Data, HashKey, EqualKey > internal_hash_map
Definition: ext_hash_map.hh:26
bool find(accessor &result, const Key &key)
Definition: ext_hash_map.hh:217
internal_hash_map::iterator iterator
Definition: ext_hash_map.hh:31
iterator begin()
Definition: ext_hash_map.hh:175
bool empty() const
Definition: ext_hash_map.hh:205
ext_hash_map(size_t s)
Definition: ext_hash_map.hh:168
bool insert(accessor &result, const Key &key)
Definition: ext_hash_map.hh:235
bool find(const_accessor &result, const Key &key) const
Definition: ext_hash_map.hh:226
internal_hash_map::size_type size_type
Definition: ext_hash_map.hh:33
void clear()
Definition: ext_hash_map.hh:211
const_iterator begin() const
Definition: ext_hash_map.hh:181
internal_hash_map map_
Definition: ext_hash_map.hh:157
bool erase(const Key &key)
Definition: ext_hash_map.hh:245
Definition: hash_support.hh:51
Definition: hash_support.hh:40