Equalizer 1.0

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.
COBASE_API bool exit ()
 De-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 49 of file rng.h.


Constructor & Destructor Documentation

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

Construct a new random number generator.

Version:
1.0

Definition at line 53 of file rng.h.

References reseed().

Here is the call graph for this function:

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

Destruct the random number generator.

Version:
1.0

Definition at line 56 of file rng.h.


Member Function Documentation

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.

Returns:
a random number.
Version:
1.0

Definition at line 74 of file rng.h.

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

Referenced by eqPly::Channel::getJitter(), and co::base::UUID::UUID().

Here is the call graph for this function:

Here is the caller 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 59 of file rng.h.

Referenced by RNG().

Here is the caller graph for this function:


Friends And Related Function Documentation

COBASE_API bool exit ( ) [friend]

De-initialize the Equalizer base classes.

Returns:
true if the library was successfully de-initialised, false otherwise.
Version:
1.0

De-initialize the Equalizer base classes.

Returns:
true if the library was successfully de-initialised, false otherwise.

De-initialize the Equalizer base classes.

Returns:
true if the library was successfully de-initialized, false otherwise.
Version:
1.0

De-initialize the Equalizer base classes.

Returns:
true if the library was successfully de-initialized, false otherwise.
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

The documentation for this class was generated from the following file:
Generated on Sun May 8 2011 19:11:09 for Equalizer 1.0 by  doxygen 1.7.3