YACLib
C++ library for concurrent tasks execution
Loading...
Searching...
No Matches
random_device.cpp
Go to the documentation of this file.
1
#include <
fault/util.hpp
>
2
3
#include <
yaclib/fault/detail/random_device.hpp
>
4
5
namespace
yaclib::detail::thread
{
6
7
RandomDevice::RandomDevice
() : _eng{
GetSeed
()} {
8
}
9
10
RandomDevice::result_type
RandomDevice::operator()
()
noexcept
{
11
return
_eng();
12
}
13
14
double
RandomDevice::entropy
()
const
noexcept
{
15
return
0;
16
}
17
18
constexpr
RandomDevice::result_type
RandomDevice::min
() {
19
return
std::mt19937_64::min();
20
}
21
22
constexpr
RandomDevice::result_type
RandomDevice::max
() {
23
return
std::mt19937_64::max();
24
}
25
26
void
RandomDevice::reset
() {
27
_eng.seed(
GetSeed
());
28
}
29
30
RandomDevice::RandomDevice
(
const
std::string&) :
RandomDevice
() {
31
}
32
33
}
// 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
random_device.hpp
yaclib::detail::thread
Definition
random_device.hpp:6
yaclib::detail::GetSeed
std::uint32_t GetSeed()
Definition
util.cpp:18
yaclib::MakeContract
Contract< V, E > MakeContract()
Creates related future and promise.
Definition
contract.hpp:25
util.hpp
src
fault
random_device.cpp
Generated by
1.9.8