hashRandomPair.h
Go to the documentation of this file.
1 /* hashRandom.h
2  */
3 #ifndef OSL_HASHRANDOMPAIR_H
4 #define OSL_HASHRANDOMPAIR_H
5 
6 #include "osl/hashKey.h"
7 
8 namespace osl
9 {
10  namespace hash
11  {
13  {
14  public:
15  static const size_t Length = 0x100000;
16  private:
17  static std::pair<char,char> table[Length];
18  static bool is_initialized;
19  public:
20  static void setUp(unsigned int seed, unsigned int prob100);
21  static std::pair<char,char> value(size_t key)
22  {
23  return table[key % Length];
24  }
25  static std::pair<char,char> value(const HashKey& key)
26  {
27  return value(key.signature());
28  }
29  static bool initialized() { return is_initialized; }
30  };
31  }
33 }
34 
35 #endif /* OSL_HASHRANDOMPAIR_H */
36 // ;;; Local Variables:
37 // ;;; mode:c++
38 // ;;; c-basic-offset:2
39 // ;;; End:
static std::pair< char, char > value(const HashKey &key)
static void setUp(unsigned int seed, unsigned int prob100)
static std::pair< char, char > table[Length]
static std::pair< char, char > value(size_t key)
static const size_t Length
uint64_t signature() const
Definition: hashKey.h:57