1 /********************* */
4 ** Original author: cconway
5 ** Major contributors: mdeters
6 ** Minor contributors (to current version): taking
7 ** This file is part of the CVC4 prototype.
8 ** Copyright (c) 2009, 2010, 2011 The Analysis of Computer Systems Group (ACSys)
9 ** Courant Institute of Mathematical Sciences
10 ** New York University
11 ** See the file COPYING in the top-level source directory for licensing
12 ** information.\endverbatim
14 ** \brief [[ Add one-line brief description here ]]
16 ** [[ Add lengthier description here ]]
17 ** \todo document this file
20 #include "cvc4_public.h"
22 #ifndef __CVC4__HASH_H
23 #define __CVC4__HASH_H
25 // in case it's not been declared as a namespace yet
26 namespace __gnu_cxx
{}
28 #include <ext/hash_map>
32 #ifdef CVC4_NEED_HASH_UINT64_T
33 // on some versions and architectures of GNU C++, we need a
34 // specialization of hash for 64-bit values
36 struct hash
<uint64_t> {
37 size_t operator()(uint64_t v
) const {
40 };/* struct hash<uint64_t> */
41 #endif /* CVC4_NEED_HASH_UINT64_T */
43 }/* __gnu_cxx namespace */
45 // hackish: treat hash stuff as if it were in std namespace
46 namespace std
{ using namespace __gnu_cxx
; }
50 struct StringHashFunction
{
51 size_t operator()(const std::string
& str
) const {
52 return std::hash
<const char*>()(str
.c_str());
54 };/* struct StringHashFunction */
56 struct StringHashStrategy
{
57 static size_t hash(const std::string
& str
) {
58 return std::hash
<const char*>()(str
.c_str());
60 };/* struct StringHashStrategy */
64 #endif /* __CVC4__HASH_H */