From 26101aeb8ea28bd180b30fc67cba81baadbba8ee Mon Sep 17 00:00:00 2001 From: Adrian Kummerlaender Date: Tue, 29 Mar 2016 20:39:19 +0200 Subject: Move random index generation into utility class --- src/random.h | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 src/random.h (limited to 'src/random.h') diff --git a/src/random.h b/src/random.h new file mode 100644 index 0000000..386dc21 --- /dev/null +++ b/src/random.h @@ -0,0 +1,34 @@ +#pragma once + +#include + +namespace utility { + +class Random { + public: + class Range { + public: + std::size_t get(); + + protected: + friend class Random; + + Range(std::mt19937* const, const std::size_t, const std::size_t); + + private: + std::mt19937* const generator_; + std::uniform_int_distribution distribution_; + }; + + Random(); + + Range makeRange(const std::size_t, const std::size_t); + + private: + std::random_device device_; + std::mt19937 generator_; + +}; + + +} -- cgit v1.2.3