Toggle navigation
ivorium
iv_components
Example project
GitHub
Main Page
Modules
Classes
Files
File List
File Members
ivorium_systems
RandomSystem
RandomGenerator.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include "
RandomSystem.hpp
"
4
#include <
ivorium_core/ivorium_core.hpp
>
5
#include <random>
6
7
namespace
iv
8
{
9
18
class
RandomGenerator
19
{
20
public
:
21
template
<
class
T >
22
RandomGenerator
(
Instance
* inst,
RandomId
id
, T
const
& identity );
23
Instance
*
instance
()
const
;
24
25
void
reset
();
26
27
// UniformRandomBitGenerator
28
using
result_type
= uint_fast32_t;
29
result_type
operator()
();
30
static
constexpr
result_type
max
() {
return
std::minstd_rand::max(); }
31
static
constexpr
result_type
min
() {
return
std::minstd_rand::min(); }
32
33
private
:
34
Instance
* inst;
35
std::minstd_rand engine;
36
37
size_t
identity_seed;
38
};
39
40
}
41
42
#include "
RandomGenerator.inl
"