HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_HashFunctor.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: UT_HashFunctor.h (UT Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __UT_HashFunctor__
12 #define __UT_HashFunctor__
13 
14 #include "UT_API.h"
15 #include <cstddef>
16 
17 /// A generic hash object which can be used by UT_Map and UT_ConcurrentHashMap.
18 /// The template argument must have a @c hash() method and a correct @c ==
19 /// operator.
20 template <typename T>
22 {
23 public:
24  /// hash() used by UT_ConcurrentHashMap
25  static size_t hash(const T &o) { return o.hash(); }
26  /// equal() function used by UT_ConcurrentHashMap
27  static bool equal(const T &a, const T &b) { return a == b; }
28 
29  /// () operator for UT_Map
30  inline size_t operator()(const T &o) const { return o.hash(); }
31 };
32 
33 #endif
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1222
static size_t hash(const T &o)
hash() used by UT_ConcurrentHashMap
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
static bool equal(const T &a, const T &b)
equal() function used by UT_ConcurrentHashMap
size_t operator()(const T &o) const
() operator for UT_Map