Equalizer  1.2.1
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 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 rng.h.

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

Destruct the random number generator.

Version:
1.0

Definition at line 62 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 80 of file rng.h.

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

Referenced by eqPly::Channel::getJitter(), eqAsync::AsyncFetcher::run(), 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 65 of file 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 Jun 8 2012 15:44:34 for Equalizer 1.2.1 by  doxygen 1.8.0