Quick Links: |
#include <bslh_seededhash.h>
Public Types | |
typedef size_t | result_type |
Public Member Functions | |
SeededHash () | |
SeededHash (SEED_GENERATOR &seedGenerator) | |
SeededHash (const SeededHash &original) | |
~SeededHash () | |
SeededHash & | operator= (const SeededHash &rhs) |
template<class TYPE > | |
result_type | operator() (const TYPE &type) const |
This class wraps the (template parameter) HASH_ALGORITHM
, which requires a seed, in an interface that satisfies the hash
requirements of the C++11 standard. The (template parameter) type SEED_GENERATOR
will be used to generate the seed required by HASH_ALGORITHM
.
typedef size_t bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::result_type |
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::SeededHash | ( | ) |
Create a bslh::SeededHash
which will default construct the (template parameter) type SEED_GENERATOR
to initialize the seed that will be passed to the (template parameter) type HASH_ALGORITHM
when it is used. SEED_GENERATOR
must be default constructible to use this constructor.
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::SeededHash | ( | SEED_GENERATOR & | seedGenerator | ) | [explicit] |
Create a bslh::SeededHash
which will use the specified seedGenerator
to initialize the seed that will be passed to the (template parameter) type HASH_ALGORITHM
when it is used. SEED_GENERATOR
must be copy-constructible to use this constructor.
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::SeededHash | ( | const SeededHash< SEED_GENERATOR, HASH_ALGORITHM > & | original | ) |
Create a bslh::SeededHash
object having the same internal state as the specified original
.
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::~SeededHash | ( | ) |
Destroy this object.
SeededHash& bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::operator= | ( | const SeededHash< SEED_GENERATOR, HASH_ALGORITHM > & | rhs | ) |
Assign to this object the value of the specified rhs
object, and return a reference providing modifiable access to this object.
result_type bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::operator() | ( | const TYPE & | type | ) | const |
Returns a hash generated by the (template parameter) type HASH_ALGORITHM
for the specified type
. The value returned by the HASH_ALGORITHM
is cast to size_t
before returning.