Equalizer
1.2.1
|
A random number generator. More...
#include <rng.h>
Public Member Functions | |
RNG () | |
Construct a new random number generator. | |
~RNG () | |
Destruct the random number generator. | |
void | reseed () |
Re-initialize the seed value for pseudo RNG's. | |
template<typename T > | |
T | get () |
Generate a random number. | |
Friends | |
COBASE_API bool | init (const int argc, char **argv) |
Initialize the Equalizer base classes. |
A random number generator.
Generates a set of random, or if not supported by the operating system, pseudo-random numbers. Each instance creates its own series of numbers.
co::base::RNG::RNG | ( | ) | [inline] |
co::base::RNG::~RNG | ( | ) | [inline] |
bool co::base::RNG::get | ( | ) | [inline] |
Generate a random number.
The returned number is between min..max for integer types, and between 0..1 for floating-point types.
Definition at line 80 of file rng.h.
References EQERROR, and co::base::sysError().
Referenced by eqPly::Channel::getJitter(), eqAsync::AsyncFetcher::run(), and co::base::UUID::UUID().
void co::base::RNG::reseed | ( | ) | [inline] |
COBASE_API bool init | ( | const int | argc, |
char ** | argv | ||
) | [friend] |
Initialize the Equalizer base classes.
argc | the command line argument count. |
argv | the command line argument values. |
Initialize the Equalizer base classes.
argc | the command line argument count. |
argv | the command line argument values. |
true
if the library was successfully initialised, false
otherwise.Initialize the Equalizer base classes.
argc | the command line argument count. |
argv | the command line argument values. |
true
if the library was successfully initialized, false
otherwise.