Quick Links:

bal | bbl | bdl | bsl

Public Member Functions

bslh::SeedGenerator< RANDOM_NUM_GEN > Class Template Reference

#include <bslh_seedgenerator.h>

List of all members.

Public Member Functions

 SeedGenerator ()
 SeedGenerator (const RANDOM_NUM_GEN &randomNumberGenerator)
 SeedGenerator (const SeedGenerator &original)
 ~SeedGenerator ()
SeedGeneratoroperator= (const SeedGenerator &rhs)
void generateSeed (char *seedLocation, size_t seedLength)

Detailed Description

template<class RANDOM_NUM_GEN>
class bslh::SeedGenerator< RANDOM_NUM_GEN >

This class template implements a seed generator which takes a user supplied random number generator and uses it to generate an arbitrary length seed. Note that this type inherits from the (template parameter) type RANDOM_NUM_GEN to take advantage of the empty-base optimization.

See Component bslh_seedgenerator


Constructor & Destructor Documentation

template<class RANDOM_NUM_GEN >
bslh::SeedGenerator< RANDOM_NUM_GEN >::SeedGenerator (  ) 

Create a bslh::SeedGenerator that will default construct the parameterized RNG and use it to generate its seeds.

template<class RANDOM_NUM_GEN >
bslh::SeedGenerator< RANDOM_NUM_GEN >::SeedGenerator ( const RANDOM_NUM_GEN &  randomNumberGenerator  )  [explicit]

Create a bslh::SeedGenerator that will use the specified randomNumberGenerator to generate its seeds.

template<class RANDOM_NUM_GEN >
bslh::SeedGenerator< RANDOM_NUM_GEN >::SeedGenerator ( const SeedGenerator< RANDOM_NUM_GEN > &  original  ) 

Create a bslh::SeedGenerator object with a copy of the random number generator used by the specified original.

template<class RANDOM_NUM_GEN >
bslh::SeedGenerator< RANDOM_NUM_GEN >::~SeedGenerator (  ) 

Destroy this object.


Member Function Documentation

template<class RANDOM_NUM_GEN >
SeedGenerator& bslh::SeedGenerator< RANDOM_NUM_GEN >::operator= ( const SeedGenerator< RANDOM_NUM_GEN > &  rhs  ) 

Assign to this object the value of the specified rhs object, and return a reference providing modifiable access to this object.

template<class RANDOM_NUM_GEN >
void bslh::SeedGenerator< RANDOM_NUM_GEN >::generateSeed ( char *  seedLocation,
size_t  seedLength 
)

Generate a seed of the specified seedLength bytes and store it at the specified seedLocation. The seed will be generated with bytes from the random number generator supplied at construction. All of the returned bytes will come from the RNG, meaning if the requested seed is larger than the return type of the RNG, the RNG will be called multiple times. The behaviour is undefined unless the memory at seedLocation can store seedLength bytes.


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