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 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #define HASH_H | 22 #define HASH_H |
23 | 23 |
24 #include <string> | 24 #include <string> |
25 | 25 |
26 #include "assert.h" | 26 #include "assert.h" |
27 #include "ptr.h" | 27 #include "ptr.h" |
28 | 28 |
29 #include "hash-function.h" | 29 #include "hash-function.h" |
30 #include "hash-murmur3.h" | 30 #include "hash-murmur3.h" |
31 #include "hash-fnv.h" | 31 #include "hash-fnv.h" |
| 32 |
| 33 #include "ns3/ns3-module.h" |
| 34 #define NS3_MODULE NS3_CORE_MODULE |
| 35 #include "ns3/ns3-export.h" |
32 | 36 |
33 /** | 37 /** |
34 * \file | 38 * \file |
35 * \ingroup hash | 39 * \ingroup hash |
36 * \brief ns3::Hasher, ns3::Hash32() and ns3::Hash64() function declarations. | 40 * \brief ns3::Hasher, ns3::Hash32() and ns3::Hash64() function declarations. |
37 */ | 41 */ |
38 | 42 |
39 namespace ns3 { | 43 namespace ns3 { |
40 | 44 |
41 /** | 45 /** |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 * \internal | 81 * \internal |
78 * | 82 * |
79 * Would be nice to offer longer hashes. \c uint128_t looks doable, | 83 * Would be nice to offer longer hashes. \c uint128_t looks doable, |
80 * except that our fallback \c int64x64_t implementation doesn't | 84 * except that our fallback \c int64x64_t implementation doesn't |
81 * offer \c unsigned. | 85 * offer \c unsigned. |
82 * | 86 * |
83 * Longer hashes require returning a byte buffer of some sort, | 87 * Longer hashes require returning a byte buffer of some sort, |
84 * but our \ref Buffer class seems a bit overkill for this case. | 88 * but our \ref Buffer class seems a bit overkill for this case. |
85 * | 89 * |
86 */ | 90 */ |
87 class Hasher | 91 class NS3_EXPORT Hasher |
88 { | 92 { |
89 public: | 93 public: |
90 /** | 94 /** |
91 * Constructor using the default implementation. | 95 * Constructor using the default implementation. |
92 */ | 96 */ |
93 Hasher (); | 97 Hasher (); |
94 /** | 98 /** |
95 * Constructor using the supplied implementation. | 99 * Constructor using the supplied implementation. |
96 * | 100 * |
97 * \param [in] hp Ptr<Hash::Implementation> to the desired implementation. | 101 * \param [in] hp Ptr<Hash::Implementation> to the desired implementation. |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 uint64_t | 300 uint64_t |
297 Hash64 (const std::string s) | 301 Hash64 (const std::string s) |
298 { | 302 { |
299 return Hasher ().GetHash64 (s); | 303 return Hasher ().GetHash64 (s); |
300 } | 304 } |
301 | 305 |
302 | 306 |
303 } // namespace ns3 | 307 } // namespace ns3 |
304 | 308 |
305 #endif /* HASH_H */ | 309 #endif /* HASH_H */ |
LEFT | RIGHT |