1/********************************************************************
2 * Copyright (c) 2013 - 2014, Pivotal Inc.
3 * All rights reserved.
4 *
5 * Author: Zhanwei Wang
6 ********************************************************************/
7/********************************************************************
8 * 2014 -
9 * open source under Apache License Version 2.0
10 ********************************************************************/
11/**
12 * Licensed to the Apache Software Foundation (ASF) under one
13 * or more contributor license agreements. See the NOTICE file
14 * distributed with this work for additional information
15 * regarding copyright ownership. The ASF licenses this file
16 * to you under the Apache License, Version 2.0 (the
17 * "License"); you may not use this file except in compliance
18 * with the License. You may obtain a copy of the License at
19 *
20 * http://www.apache.org/licenses/LICENSE-2.0
21 *
22 * Unless required by applicable law or agreed to in writing, software
23 * distributed under the License is distributed on an "AS IS" BASIS,
24 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 * See the License for the specific language governing permissions and
26 * limitations under the License.
27 */
28#include "Hash.h"
29
30#ifdef NEED_BOOST
31
32#include <boost/functional/hash.hpp>
33
34namespace Hdfs {
35namespace Internal {
36
37/**
38 * A hash function object used to hash a boolean value.
39 */
40boost::hash<bool> BoolHasher;
41
42/**
43 * A hash function object used to hash an int value.
44 */
45boost::hash<int> Int32Hasher;
46
47/**
48 * A hash function object used to hash an 64 bit int value.
49 */
50boost::hash<int64_t> Int64Hasher;
51
52/**
53 * A hash function object used to hash a size_t value.
54 */
55boost::hash<size_t> SizeHasher;
56
57/**
58 * A hash function object used to hash a std::string object.
59 */
60boost::hash<std::string> StringHasher;
61}
62}
63
64#else
65
66#include <functional>
67
68namespace Hdfs {
69namespace Internal {
70
71/**
72 * A hash function object used to hash a boolean value.
73 */
74std::hash<bool> BoolHasher;
75
76/**
77 * A hash function object used to hash an int value.
78 */
79std::hash<int> Int32Hasher;
80
81/**
82 * A hash function object used to hash an 64 bit int value.
83 */
84std::hash<int64_t> Int64Hasher;
85
86/**
87 * A hash function object used to hash a size_t value.
88 */
89std::hash<size_t> SizeHasher;
90
91/**
92 * A hash function object used to hash a std::string object.
93 */
94std::hash<std::string> StringHasher;
95
96}
97}
98
99#endif
100