summaryrefslogtreecommitdiff
path: root/decoder/hash.h
diff options
context:
space:
mode:
authorredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-11 02:37:10 +0000
committerredpony <redpony@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-08-11 02:37:10 +0000
commita53461650fbdcd3cfe7543d28af9647ac3e5e47e (patch)
treee812756c733b34f9c16894265204acfa9f9998a9 /decoder/hash.h
parent19b59489bb600f438ad96f04ec5d5c5b6616c9c2 (diff)
major refactor, break bad circular deps
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@509 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'decoder/hash.h')
-rwxr-xr-xdecoder/hash.h54
1 files changed, 0 insertions, 54 deletions
diff --git a/decoder/hash.h b/decoder/hash.h
deleted file mode 100755
index 3a60a429..00000000
--- a/decoder/hash.h
+++ /dev/null
@@ -1,54 +0,0 @@
-#ifndef CDEC_HASH_H
-#define CDEC_HASH_H
-
-#include "murmur_hash.h"
-
-#include "config.h"
-#ifdef HAVE_SPARSEHASH
-# include <google/dense_hash_map>
-# define HASH_MAP google::dense_hash_map
-# define HASH_MAP_RESERVED(h,empty,deleted) do { h.set_empty_key(empty); h.set_deleted_key(deleted); } while(0)
-# define HASH_MAP_EMPTY(h,empty) do { h.set_empty_key(empty); } while(0)
-#else
-# include <tr1/unordered_map>
-# define HASH_MAP std::tr1::unordered_map
-# define HASH_MAP_RESERVED(h,empty,deleted)
-# define HASH_MAP_EMPTY(h,empty)
-#endif
-
-#include <boost/functional/hash.hpp>
-
-// assumes C is POD
-template <class C>
-struct murmur_hash
-{
- typedef MurmurInt return_type;
- typedef C /*const&*/ argument_type;
- return_type operator()(argument_type const& c) const {
- return MurmurHash((void*)&c,sizeof(c));
- }
-};
-
-// murmur_hash_array isn't std guaranteed safe (you need to use string::data())
-template <>
-struct murmur_hash<std::string>
-{
- typedef MurmurInt return_type;
- typedef std::string /*const&*/ argument_type;
- return_type operator()(argument_type const& c) const {
- return MurmurHash(c.data(),c.size());
- }
-};
-
-// uses begin(),size() assuming contiguous layout and POD
-template <class C>
-struct murmur_hash_array
-{
- typedef MurmurInt return_type;
- typedef C /*const&*/ argument_type;
- return_type operator()(argument_type const& c) const {
- return MurmurHash(&*c.begin(),c.size()*sizeof(*c.begin()));
- }
-};
-
-#endif