# class Random

Pseudo random number generator. More...

Full name | `TelEngine::Random`
Definition | `#include <yateclass.h>`
List of all Methods

Annotated List
Files
Globals
Hierarchy
Index

#### Public Methods

- inline Random (u_int32_t seed = Time::now() & 0xffffffff)
- inline u_int32_t get () const
- inline void set (u_int32_t seed)
- u_int32_t next ()

#### Public Static Methods

- static long int random ()
- static void srandom (unsigned int seed)

## Detailed Description

Implementation of a system independent pseudo random number generator

inline Random (u_int32_t seed = Time::now() & 0xffffffff)

### Random

Constructor

Parameters:

seed | Number to use as initial sequence seed

inline u_int32_t get ()

### get

[const]

Get the latest random number generated

Returns: Last random number generated

inline void set (u_int32_t seed)

### set

Set the pseudo random generator to a known state

Parameters:

seed | Number to set as current state

u_int32_t next ()

### next

Advance the pseudo random sequence and return new value

Returns: Next random number in sequence

long int random ()

### random

[static]

Thread safe (and shared) replacement for library ::random()

Returns: Next random number in the global sequence

void srandom (unsigned int seed)

### srandom

[static]

Thread safe (and shared) replacement for library ::srandom()

Parameters:

seed | Number to set as seed in the global sequence

Generated by: paulc on bussard on Fri Dec 21 16:28:34 2012, using kdoc 2.0a54.