Lunchbox  1.4.0
Public Member Functions | Friends
lunchbox::RNG Class Reference

A random number generator. More...

#include <rng.h>

+ Inheritance diagram for lunchbox::RNG:
+ Collaboration diagram for lunchbox::RNG:

List of all members.

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 >
get ()
 Generate a random number.

Friends

bool init (const int argc, char **argv)
 Initialize the Lunchbox base classes.

Detailed Description

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.

Definition at line 38 of file rng.h.


Constructor & Destructor Documentation

Construct a new random number generator.

Version:
1.0

Destruct the random number generator.

Version:
1.0

Member Function Documentation

bool lunchbox::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.

Returns:
a random number.
Version:
1.0

Definition at line 58 of file rng.h.

Re-initialize the seed value for pseudo RNG's.

Version:
1.0

Friends And Related Function Documentation

bool init ( const int  argc,
char **  argv 
) [friend]

Initialize the Lunchbox base classes.

Parameters:
argcthe command line argument count.
argvthe command line argument values.
Returns:
true if the library was successfully initialised, false otherwise
Version:
1.0

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