YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
random_device.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <random>
4
#include <string>
5
6
namespace
yaclib::detail::thread
{
7
8
// TODO(myannyax) Refactor this shit
9
10
class
RandomDevice
{
11
public
:
12
using
result_type
= std::mt19937_64::result_type;
13
14
RandomDevice
();
15
16
explicit
RandomDevice
(
const
std::string&
/*token*/
);
17
18
result_type
operator()
()
noexcept
;
19
20
[[
nodiscard
]]
double
entropy
()
const
noexcept
;
21
22
static
constexpr
result_type
min
();
23
24
static
constexpr
result_type
max
();
25
26
~
RandomDevice
() =
default
;
27
28
void
reset
();
29
30
RandomDevice
(
const
RandomDevice
&) =
delete
;
31
32
RandomDevice
&
operator
=(
const
RandomDevice
&) =
delete
;
33
34
private
:
35
std::mt19937_64 _eng;
36
};
37
38
}
// namespace yaclib::detail::thread
yaclib::detail::thread::RandomDevice
Definition
random_device.hpp:10
yaclib::detail::thread::RandomDevice::max
static constexpr result_type max()
Definition
random_device.cpp:22
yaclib::detail::thread::RandomDevice::min
static constexpr result_type min()
Definition
random_device.cpp:18
yaclib::detail::thread::RandomDevice::RandomDevice
RandomDevice()
Definition
random_device.cpp:7
yaclib::detail::thread::RandomDevice::operator()
result_type operator()() noexcept
Definition
random_device.cpp:10
yaclib::detail::thread::RandomDevice::reset
void reset()
Definition
random_device.cpp:26
yaclib::detail::thread::RandomDevice::entropy
double entropy() const noexcept
Definition
random_device.cpp:14
yaclib::detail::thread::RandomDevice::result_type
std::mt19937_64::result_type result_type
Definition
random_device.hpp:12
yaclib::detail::thread
Definition
random_device.hpp:6
yaclib::MakeContract
Contract< V, E > MakeContract()
Creates related future and promise.
Definition
contract.hpp:25
include
yaclib
fault
detail
random_device.hpp
Generated by
1.9.8