BDE 4.14.0 Production release
Loading...
Searching...
No Matches
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM > Struct Template Reference

#include <bslh_seededhash.h>

Public Types

typedef size_t result_type
 

Public Member Functions

 SeededHash ()
 
 SeededHash (SEED_GENERATOR &seedGenerator)
 
 SeededHash (const SeededHash &original)=default
 
 ~SeededHash ()=default
 
SeededHashoperator= (const SeededHash &rhs)=default
 
template<class TYPE >
result_type operator() (const TYPE &type) const
 

Detailed Description

template<class SEED_GENERATOR, class HASH_ALGORITHM = bslh::DefaultSeededHashAlgorithm>
struct bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >

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.

Member Typedef Documentation

◆ result_type

template<class SEED_GENERATOR , class HASH_ALGORITHM = bslh::DefaultSeededHashAlgorithm>
typedef size_t bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::result_type

The type of the hash value that will be returned by the function-call operator.

Constructor & Destructor Documentation

◆ SeededHash() [1/3]

template<class SEED_GENERATOR , class HASH_ALGORITHM >
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::SeededHash ( )
inline

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.

◆ SeededHash() [2/3]

template<class SEED_GENERATOR , class HASH_ALGORITHM >
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::SeededHash ( SEED_GENERATOR &  seedGenerator)
inlineexplicit

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.

◆ SeededHash() [3/3]

template<class SEED_GENERATOR , class HASH_ALGORITHM = bslh::DefaultSeededHashAlgorithm>
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::SeededHash ( const SeededHash< SEED_GENERATOR, HASH_ALGORITHM > &  original)
default

◆ ~SeededHash()

template<class SEED_GENERATOR , class HASH_ALGORITHM = bslh::DefaultSeededHashAlgorithm>
bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::~SeededHash ( )
default

Member Function Documentation

◆ operator()()

template<class SEED_GENERATOR , class HASH_ALGORITHM >
template<class TYPE >
SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::result_type bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::operator() ( const TYPE &  type) const
inline

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.

◆ operator=()

template<class SEED_GENERATOR , class HASH_ALGORITHM = bslh::DefaultSeededHashAlgorithm>
SeededHash & bslh::SeededHash< SEED_GENERATOR, HASH_ALGORITHM >::operator= ( const SeededHash< SEED_GENERATOR, HASH_ALGORITHM > &  rhs)
default

The documentation for this struct was generated from the following file: