LEFT | RIGHT |
(no file at all) | |
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ | 1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */ |
2 /* | 2 /* |
3 * Copyright (c) 2012 Lawrence Livermore National Laboratory | 3 * Copyright (c) 2012 Lawrence Livermore National Laboratory |
4 * | 4 * |
5 * This program is free software; you can redistribute it and/or modify | 5 * This program is free software; you can redistribute it and/or modify |
6 * it under the terms of the GNU General Public License version 2 as | 6 * it under the terms of the GNU General Public License version 2 as |
7 * published by the Free Software Foundation; | 7 * published by the Free Software Foundation; |
8 * | 8 * |
9 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12 * GNU General Public License for more details. | 12 * GNU General Public License for more details. |
13 * | 13 * |
14 * You should have received a copy of the GNU General Public License | 14 * You should have received a copy of the GNU General Public License |
15 * along with this program; if not, write to the Free Software | 15 * along with this program; if not, write to the Free Software |
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
17 * | 17 * |
18 * Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov> | 18 * Author: Peter D. Barnes, Jr. <pdbarnes@llnl.gov> |
19 */ | 19 */ |
20 | 20 |
21 #ifndef HASH_MURMUR3_H | 21 #ifndef HASH_MURMUR3_H |
22 #define HASH_MURMUR3_H | 22 #define HASH_MURMUR3_H |
23 | 23 |
24 #include "hash-function.h" | 24 #include "hash-function.h" |
| 25 |
| 26 #include "ns3/ns3-module.h" |
| 27 #define NS3_MODULE NS3_CORE_MODULE |
| 28 #include "ns3/ns3-export.h" |
25 | 29 |
26 /** | 30 /** |
27 * \file | 31 * \file |
28 * \ingroup hash | 32 * \ingroup hash |
29 * \brief ns3::Hash::Function::Murmur3 declaration. | 33 * \brief ns3::Hash::Function::Murmur3 declaration. |
30 */ | 34 */ |
31 | 35 |
32 namespace ns3 { | 36 namespace ns3 { |
33 | 37 |
34 namespace Hash { | 38 namespace Hash { |
35 | 39 |
36 namespace Function { | 40 namespace Function { |
37 | 41 |
38 /** | 42 /** |
39 * \ingroup hash | 43 * \ingroup hash |
40 * | 44 * |
41 * \brief Murmur3 hash function implementation | 45 * \brief Murmur3 hash function implementation |
42 * | 46 * |
43 * Adapted from http://code.google.com/p/smhasher/ | 47 * Adapted from http://code.google.com/p/smhasher/ |
44 * | 48 * |
45 * MurmurHash3 was written by Austin Appleby, and is placed in the public | 49 * MurmurHash3 was written by Austin Appleby, and is placed in the public |
46 * domain. The author hereby disclaims copyright to this source code. | 50 * domain. The author hereby disclaims copyright to this source code. |
47 | 51 |
48 * Note - The x86 and x64 versions do _not_ produce the same results, as the | 52 * Note - The x86 and x64 versions do _not_ produce the same results, as the |
49 * algorithms are optimized for their respective platforms. You can still | 53 * algorithms are optimized for their respective platforms. You can still |
50 * compile and run any of them on any platform, but your performance with the | 54 * compile and run any of them on any platform, but your performance with the |
51 * non-native version will be less than optimal. | 55 * non-native version will be less than optimal. |
52 */ | 56 */ |
53 class Murmur3 : public Implementation | 57 class NS3_EXPORT Murmur3 : public Implementation |
54 { | 58 { |
55 public: | 59 public: |
56 /** | 60 /** |
57 * Constructor, clears internal state | 61 * Constructor, clears internal state |
58 */ | 62 */ |
59 Murmur3 (); | 63 Murmur3 (); |
60 /** | 64 /** |
61 * Compute 32-bit hash of a byte buffer | 65 * Compute 32-bit hash of a byte buffer |
62 * | 66 * |
63 * Call clear () between calls to GetHash32() to reset the | 67 * Call clear () between calls to GetHash32() to reset the |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 ······ | 124 ······ |
121 }; // class Murmur3 | 125 }; // class Murmur3 |
122 | 126 |
123 } // namespace Function | 127 } // namespace Function |
124 | 128 |
125 } // namespace Hash | 129 } // namespace Hash |
126 | 130 |
127 } // namespace ns3 | 131 } // namespace ns3 |
128 | 132 |
129 #endif /* HASH_MURMUR3_H */ | 133 #endif /* HASH_MURMUR3_H */ |
LEFT | RIGHT |