RandomGenerator.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "RandomSystem.hpp"
5 #include <random>
6 
7 namespace iv
8 {
9 
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;
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"