Skip to content
This repository was archived by the owner on Sep 27, 2019. It is now read-only.

Commit 368bc7c

Browse files
Added HashType to common/container/cuckoo_map.h
1 parent 93f5e0e commit 368bc7c

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

src/include/common/container/cuckoo_map.h

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,26 @@
1818
#include <cstdio>
1919

2020
#include "libcuckoo/cuckoohash_map.hh"
21+
#include "libcuckoo/default_hasher.hh"
2122

2223
namespace peloton {
2324

2425
// CUCKOO_MAP_TEMPLATE_ARGUMENTS
2526
#define CUCKOO_MAP_TEMPLATE_ARGUMENTS template <typename KeyType, \
26-
typename ValueType>
27+
typename ValueType, typename HashType >
28+
29+
// CUCKOO_MAP_DEFAULT_ARGUMENTS
30+
#define CUCKOO_MAP_DEFAULT_ARGUMENTS template <typename KeyType, \
31+
typename ValueType, typename HashType = DefaultHasher<KeyType> >
2732

2833
// CUCKOO_MAP_TYPE
29-
#define CUCKOO_MAP_TYPE CuckooMap<KeyType, ValueType>
34+
#define CUCKOO_MAP_TYPE CuckooMap<KeyType, ValueType, HashType >
3035

3136
// Iterator type
3237
#define CUCKOO_MAP_ITERATOR_TYPE \
3338
typename cuckoohash_map<KeyType, ValueType>::locked_table
3439

35-
CUCKOO_MAP_TEMPLATE_ARGUMENTS
40+
CUCKOO_MAP_DEFAULT_ARGUMENTS
3641
class CuckooMap {
3742
public:
3843

@@ -72,7 +77,7 @@ class CuckooMap {
7277
private:
7378

7479
// cuckoo map
75-
typedef cuckoohash_map<KeyType, ValueType> cuckoo_map_t;
80+
typedef cuckoohash_map<KeyType, ValueType, HashType> cuckoo_map_t;
7681

7782
cuckoo_map_t cuckoo_map;
7883
};

0 commit comments

Comments
 (0)