Scopira  20080306
scopira::tool::sysdev_gen Class Reference

#include <random.h>

Public Types

typedef unsigned int result_type
 

Public Member Functions

 sysdev_gen (const std::string &token=default_token)
 
 ~sysdev_gen ()
 dtor
 
result_type min (void) const
 min val
 
result_type max (void) const
 max val
 
result_type operator() (void)
 
result_type operator() (result_type mx)
 

Static Public Attributes

static const bool has_fixed_range = true
 

Detailed Description

a class that connects to an os device to generate non-deterministic random numbers

Author
Aleksander Demko

Constructor & Destructor Documentation

◆ sysdev_gen()

scopira::tool::sysdev_gen::sysdev_gen ( const std::string &  token = default_token)
explicit

Constructor. By default, uses /dev/urandom under linux.

Author
Aleksander Demko

Member Function Documentation

◆ operator()() [1/2]

result_type scopira::tool::sysdev_gen::operator() ( void  )

Gets the next number in the sequence.

Author
Aleksander Demko

Referenced by max().

◆ operator()() [2/2]

result_type scopira::tool::sysdev_gen::operator() ( result_type  mx)
inline

Gets the next number in the sequence. Capped by mx (that is, <mx). Not numerically sound (FIXME).

Author
Aleksander Demko

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