Yate
|
Pseudo random number generator. More...
#include <yateclass.h>
Public Member Functions | |
Random (u_int32_t seed=Time::now()&0xffffffff) | |
u_int32_t | get () const |
void | set (u_int32_t seed) |
u_int32_t | next () |
Static Public Member Functions | |
static long int | random () |
static void | srandom (unsigned int seed) |
Pseudo random number generator.
Implementation of a system independent pseudo random number generator
Constructor
seed | Number to use as initial sequence seed |
|
inline |
Get the latest random number generated
u_int32_t next | ( | ) |
Advance the pseudo random sequence and return new value
|
static |
Thread safe (and shared) replacement for library ::random()
|
inline |
Set the pseudo random generator to a known state
seed | Number to set as current state |
|
static |
Thread safe (and shared) replacement for library ::srandom()
seed | Number to set as seed in the global sequence |