Atoms Crowd  7.0.0
Hash.h
1 #pragma once
2 // ===========================================================================
3 // Copyright (c) 2015 Toolchefs Ltd. All rights reserved.
4 //
5 // Use of this software is subject to the terms of the Toolchefs license
6 // agreement provided at the time of installation or download, or which
7 // otherwise accompanies this software in either electronic or hard copy form.
8 // ===========================================================================
9 
10 //-----------------------------------------------------------------------------
11 // MurmurHash3 was written by Austin Appleby, and is placed in the public
12 // domain. The author hereby disclaims copyright to this source code.
13 // Code from https://github.com/aappleby/smhasher
14 
15 #include <AtomsCore/Globals.h>
16 #include <AtomsCore/AtomsMath.h>
17 #include <string>
18 #include <vector>
19 
20 namespace AtomsCore
21 {
22  class ATOMSCORE_EXPORT MurmurHash3
23  {
24  public:
25  MurmurHash3();
26 
27  MurmurHash3(const MurmurHash3& rh);
28 
29  inline const MurmurHash3 &operator = (const MurmurHash3 &rh);
30 
31  inline bool operator==(const MurmurHash3 &rh) const;
32 
33  inline bool operator!=(const MurmurHash3 &rh) const;
34 
35  inline bool operator<(const MurmurHash3 &rh) const;
36 
37  inline void hash(const void *data, size_t bytes);
38 
39  inline void append(bool data);
40 
41  inline void append(char data);
42 
43  inline void append(unsigned char data);
44 
45  inline void append(short data);
46 
47  inline void append(unsigned short data);
48 
49  inline void append(int data);
50 
51  inline void append(unsigned int data);
52 
53  inline void append(int64_t data);
54 
55  inline void append(uint64_t data);
56 #ifdef __APPLE__
57  inline void append(size_t data);
58 #endif
59  inline void append(float data);
60 
61  inline void append(double data);
62 
63  inline void append(const char *data);
64 
65  inline void append(const std::string &data);
66 
67  inline void append(const Vector2 &data);
68 
69  inline void append(const Vector2f &data);
70 
71  inline void append(const Vector2i &data);
72 
73  inline void append(const Vector3 &data);
74 
75  inline void append(const Vector3f &data);
76 
77  inline void append(const Vector3i &data);
78 
79  inline void append(const Vector4 &data);
80 
81  inline void append(const Vector4f &data);
82 
83  inline void append(const Vector4i &data);
84 
85  inline void append(const Euler &data);
86 
87  inline void append(const Eulerf &data);
88 
89  inline void append(const Quaternion &data);
90 
91  inline void append(const Quaternionf &data);
92 
93  inline void append(const Box2 &data);
94 
95  inline void append(const Box2i &data);
96 
97  inline void append(const Box2f &data);
98 
99  inline void append(const Box3 &data);
100 
101  inline void append(const Box3i &data);
102 
103  inline void append(const Box3f &data);
104 
105  inline void append(const Matrix &data);
106 
107  inline void append(const Matrixf &data);
108 
109  inline void append(const std::vector<bool>& data);
110 
111  inline void append(const std::vector<char>& data);
112 
113  inline void append(const std::vector<unsigned char>& data);
114 
115  inline void append(const std::vector<short>& data);
116 
117  inline void append(const std::vector<unsigned short>& data);
118 
119  inline void append(const std::vector<int>& data);
120 
121  inline void append(const std::vector<unsigned int>& data);
122 
123  inline void append(const std::vector<int64_t>& data);
124 
125  inline void append(const std::vector<uint64_t>& data);
126 
127  inline void append(const std::vector<float>& data);
128 
129  inline void append(const std::vector<double>& data);
130 
131  inline void append(const std::vector<std::string>& data);
132 
133  inline void append(const std::vector<Vector2>& data);
134 
135  inline void append(const std::vector<Vector2f>& data);
136 
137  inline void append(const std::vector<Vector2i>& data);
138 
139  inline void append(const std::vector<Vector3>& data);
140 
141  inline void append(const std::vector<Vector3f>& data);
142 
143  inline void append(const std::vector<Vector3i>& data);
144 
145  inline void append(const std::vector<Vector4>& data);
146 
147  inline void append(const std::vector<Vector4f>& data);
148 
149  inline void append(const std::vector<Vector4i>& data);
150 
151  inline void append(const std::vector<Euler>& data);
152 
153  inline void append(const std::vector<Eulerf>& data);
154 
155  inline void append(const std::vector<Quaternion>& data);
156 
157  inline void append(const std::vector<Quaternionf>& data);
158 
159  inline void append(const std::vector<Box2>& data);
160 
161  inline void append(const std::vector<Box2i>& data);
162 
163  inline void append(const std::vector<Box2f>& data);
164 
165  inline void append(const std::vector<Box3>& data);
166 
167  inline void append(const std::vector<Box3i>& data);
168 
169  inline void append(const std::vector<Box3f>& data);
170 
171  inline void append(const std::vector<Matrix>& data);
172 
173  inline void append(const std::vector<Matrixf>& data);
174 
175  inline void append(const MurmurHash3& data);
176 
177  std::string string() const;
178 
179  public:
180 
181  uint64_t seed[2];
182  };
183 }
184 
185 ATOMSCORE_EXPORT std::ostream &operator << (std::ostream &o, const AtomsCore::MurmurHash3 &hash);
186 
187 #include "Hash.impl.h"
Definition: Hash.h:23
Definition: ImathEuler.h:118
AtomsCore namespace.
Definition: Agent.h:344
AtomsMath::Vector4f Vector4f
Vector4 class.
Definition: AtomsMath.h:61
AtomsMath::Vector3i Vector3i
Vector3i class.
Definition: AtomsMath.h:59
AtomsMath::Vector2 Vector2
Vector2 class.
Definition: AtomsMath.h:54
AtomsMath::Vector4i Vector4i
Vector4 class.
Definition: AtomsMath.h:62
AtomsMath::Box2i Box2i
Bounding box class.
Definition: AtomsMath.h:73
AtomsMath::Quaternion Quaternion
Quaternion class.
Definition: AtomsMath.h:67
AtomsMath::Vector2i Vector2i
Vector2 class.
Definition: AtomsMath.h:56
AtomsMath::Box2f Box2f
Bounding box class.
Definition: AtomsMath.h:72
AtomsMath::Vector4 Vector4
Vector4 class.
Definition: AtomsMath.h:60
AtomsMath::Box3 Box3
Bounding box class.
Definition: AtomsMath.h:74
AtomsMath::Box2 Box2
Bounding box class.
Definition: AtomsMath.h:71
AtomsMath::Matrixf Matrixf
Matrix class.
Definition: AtomsMath.h:64
AtomsMath::Vector2f Vector2f
Vector2 class.
Definition: AtomsMath.h:55
AtomsMath::Vector3 Vector3
Vector3 class.
Definition: AtomsMath.h:57
AtomsMath::Matrix Matrix
Matrix class.
Definition: AtomsMath.h:63
AtomsMath::Eulerf Eulerf
Euler class.
Definition: AtomsMath.h:70
AtomsMath::Box3f Box3f
Bounding box class.
Definition: AtomsMath.h:75
AtomsMath::Vector3f Vector3f
Vector3 class.
Definition: AtomsMath.h:58
AtomsMath::Box3i Box3i
Bounding box class.
Definition: AtomsMath.h:76
AtomsMath::Quaternionf Quaternionf
Quaternion class.
Definition: AtomsMath.h:68