]> Dogcows Code - chaz/yoink/blob - src/moof/hash.hh
testing new non-autotools build system
[chaz/yoink] / src / moof / hash.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #ifndef _MOOF_HASH_HH_
13 #define _MOOF_HASH_HH_
14
15 /**
16 * \file hash.hh
17 * Hash tables and functions.
18 */
19
20 #include <string>
21
22 #include <stlplus/containers/hash.hpp>
23
24
25 namespace moof {
26
27
28 using stlplus::hash;
29
30
31 struct hash_function
32 {
33 // generic hash function
34 unsigned operator () (const void* key, int len,
35 unsigned seed = -1) const;
36
37 unsigned operator () (const std::string& val) const
38 {
39 return (*this)(val.data(), val.length());
40 }
41
42 unsigned operator () (int val) const
43 {
44 return val;
45 }
46 };
47
48
49 } // namespace moof
50
51 #endif // _MOOF_HASH_HH_
52
This page took 0.030866 seconds and 4 git commands to generate.