hashRandomPair.h
Go to the documentation of this file.
/* hashRandom.h
*/
#ifndef OSL_HASHRANDOMPAIR_H
#define OSL_HASHRANDOMPAIR_H
#include "osl/hashKey.h"
namespace osl
{
namespace hash
{
class HashRandomPair
{
public:
static const size_t Length = 0x100000;
private:
static std::pair<char,char> table[Length];
static bool is_initialized;
public:
static void setUp(unsigned int seed, unsigned int prob100);
static std::pair<char,char> value(size_t key)
{
return table[key % Length];
}
static std::pair<char,char> value(const HashKey& key)
{
return value(key.signature());
}
static bool initialized() { return is_initialized; }
};
}
using hash::HashRandomPair;
}
#endif /* OSL_HASHRANDOMPAIR_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::hash::HashKey128::signature
uint64_t signature() const
Definition hashKey.h:57
osl::hash::HashKey
Definition hashKey.h:153
osl::hash::HashRandomPair
Definition hashRandomPair.h:13
osl::hash::HashRandomPair::table
static std::pair< char, char > table[Length]
Definition hashRandomPair.h:17
osl::hash::HashRandomPair::Length
static const size_t Length
Definition hashRandomPair.h:15
osl::hash::HashRandomPair::setUp
static void setUp(unsigned int seed, unsigned int prob100)
Definition hashRandomPair.cc:10
osl::hash::HashRandomPair::initialized
static bool initialized()
Definition hashRandomPair.h:29
osl::hash::HashRandomPair::value
static std::pair< char, char > value(size_t key)
Definition hashRandomPair.h:21
osl::hash::HashRandomPair::is_initialized
static bool is_initialized
Definition hashRandomPair.h:18
osl::hash::HashRandomPair::value
static std::pair< char, char > value(const HashKey &key)
Definition hashRandomPair.h:25
hashKey.h
osl::hash
Definition hashKey.h:14
osl
Definition additionalEffect.h:6