Equalizer  1.3.1-git
Public Member Functions | Friends
co::base::RNG Class Reference

A random number generator. More...

#include <rng.h>

+ Inheritance diagram for co::base::RNG:
+ Collaboration diagram for co::base::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

COBASE_API bool init (const int argc, char **argv)
 Initialize the Equalizer 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 55 of file co/base/rng.h.


Constructor & Destructor Documentation

co::base::RNG::RNG ( ) [inline]

Construct a new random number generator.

Version:
1.0

Definition at line 59 of file co/base/rng.h.

co::base::RNG::~RNG ( ) [inline]

Destruct the random number generator.

Version:
1.0

Definition at line 62 of file co/base/rng.h.


Member Function Documentation

template<typename T >
T 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.

Returns:
a random number.
Version:
1.0

Definition at line 80 of file co/base/rng.h.

References EQERROR, and co::base::sysError().

+ Here is the call graph for this function:

void co::base::RNG::reseed ( ) [inline]

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

Version:
1.0

Definition at line 65 of file co/base/rng.h.


Friends And Related Function Documentation

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

Initialize the Equalizer 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

Initialize the Equalizer base classes.

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

Initialize the Equalizer base classes.

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

Definition at line 38 of file co/init.h.


The documentation for this class was generated from the following file:
Generated on Fri Apr 20 2012 12:21:50 for Equalizer 1.3.1-git by  doxygen 1.8.0