All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
hashRandom.h
Go to the documentation of this file.
1 /* hashRandom.h
2  */
3 #ifndef OSL_HASHRANDOM_H
4 #define OSL_HASHRANDOM_H
5 
6 #include "osl/hash/hashKey.h"
7 #include "osl/misc/carray.h"
8 
9 namespace osl
10 {
11  namespace hash
12  {
13  class HashRandom
14  {
15  public:
16  static const size_t Length = 0x1000;
17  private:
18  static CArray<int,Length> table;
19  public:
20  static void setUp(double sigma);
21  static int value(size_t key)
22  {
23  return table[key % Length];
24  }
25  static int value(const HashKey& key)
26  {
27  return value(key.signature());
28  }
29  };
30  }
31  using hash::HashRandom;
32 }
33 
34 #endif /* OSL_HASHRANDOM_H */
35 // ;;; Local Variables:
36 // ;;; mode:c++
37 // ;;; c-basic-offset:2
38 // ;;; End: