libmoost
|
modulo_partitioner hashes the key then modulos the result against the number of buckets. This results in an even spread given a reasonable hasher. More...
#include <modulo_partitioner.hpp>
Public Member Functions | |
basic_partitioner (size_t num_buckets) | |
size_t | partition (const T &key) const |
return a bucket for the given key | |
Private Attributes | |
boost::hash< T > | m_hasher |
modulo_partitioner hashes the key then modulos the result against the number of buckets. This results in an even spread given a reasonable hasher.
Definition at line 39 of file modulo_partitioner.hpp.
moost::algorithm::modulo_partitioner< T >::basic_partitioner | ( | size_t | num_buckets | ) | [inline] |
constructs a basic_partitioner
num_buckets | the number of buckets to partition into. |
Definition at line 49 of file modulo_partitioner.hpp.
size_t moost::algorithm::modulo_partitioner< T >::partition | ( | const T & | key | ) | const [inline, virtual] |
return a bucket for the given key
Implements moost::algorithm::partitioner< T >.
Definition at line 55 of file modulo_partitioner.hpp.
boost::hash<T> moost::algorithm::modulo_partitioner< T >::m_hasher [private] |
Definition at line 43 of file modulo_partitioner.hpp.