Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
websocketpp::random::random_device::int_generator< int_type, concurrency > Class Template Reference

Thread safe non-deterministic random integer generator. More...

#include <random_device.hpp>

Public Types

typedef concurrency::scoped_lock_type scoped_lock_type
 
typedef concurrency::mutex_type mutex_type
 

Public Member Functions

 int_generator ()
 constructor
 
int_type operator() ()
 advances the engine's state and returns the generated value
 

Detailed Description

template<typename int_type, typename concurrency>
class websocketpp::random::random_device::int_generator< int_type, concurrency >

This template class provides thread safe non-deterministic random integer generation. Numbers are produced in a uniformly distributed range from the smallest to largest value that int_type can store.

Thread-safety is provided via locking based on the concurrency template parameter.

Non-deterministic RNG is provided via websocketpp::lib which uses either C++11 or Boost 1.47+'s random_device class.

Call operator() to generate the next number

Definition at line 53 of file random_device.hpp.

Member Typedef Documentation

◆ mutex_type

template<typename int_type , typename concurrency >
concurrency::mutex_type websocketpp::random::random_device::int_generator< int_type, concurrency >::mutex_type

Definition at line 56 of file random_device.hpp.

◆ scoped_lock_type

template<typename int_type , typename concurrency >
concurrency::scoped_lock_type websocketpp::random::random_device::int_generator< int_type, concurrency >::scoped_lock_type

Definition at line 55 of file random_device.hpp.

Constructor & Destructor Documentation

◆ int_generator()

template<typename int_type , typename concurrency >
websocketpp::random::random_device::int_generator< int_type, concurrency >::int_generator ( )
inline

Definition at line 60 of file random_device.hpp.

60{}

Member Function Documentation

◆ operator()()

template<typename int_type , typename concurrency >
int_type websocketpp::random::random_device::int_generator< int_type, concurrency >::operator() ( )
inline

Definition at line 63 of file random_device.hpp.

63 {
64 scoped_lock_type guard(m_lock);
65 return m_dis(m_rng);
66 }

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