Cachemere
Modular Caching Library for C++
|
Functor used for generating a uniform sequence of numbers in a given value range for a given key. More...
#include <hash_mixer.h>
Public Member Functions | |
HashMixer (const Key &key, size_t value_range) | |
Constructor. More... | |
size_t | operator() () |
Generate the next value in the random sequence. More... | |
Functor used for generating a uniform sequence of numbers in a given value range for a given key.
Key | The type of the key to be used as seed. |
KeyHash | The functor to use for turning the provided key into a seed for the internal pseudo-random number generator. |
cachemere::policy::detail::HashMixer< Key, KeyHash >::HashMixer | ( | const Key & | key, |
size_t | value_range | ||
) |
Constructor.
key | The key to use to seed this instance. |
value_range | The upper bound of the value range. This mixer will return values in the range [0, value_range) . |
size_t cachemere::policy::detail::HashMixer< Key, KeyHash >::operator() |
Generate the next value in the random sequence.