BICO 1.1

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Pages
randomgenerator.h
Go to the documentation of this file.
1 #ifndef RANDOMGENERATOR_H
2 #define RANDOMGENERATOR_H
3
7 class RandomGenerator
8 {
9 private:
10 std::mt19937 * generator;
11 public:
12 typedef decltype((*generator)()) result_type;
13
14 RandomGenerator(std::mt19937 * generator) :
15 generator(generator)
16 {
17 }
18
19 result_type operator()()
20 {
21 return (*generator)();
22 }
23
24 result_type min()
25 {
26 return generator->min();
27 }
28
29 result_type max()
30 {
31 return generator->max();
32 }
33 };
34
35 #endif
RandomGenerator
Encapsulates an STL random generator.
Definition: randomgenerator.h:7
RandomGenerator::operator()
result_type operator()()
Definition: randomgenerator.h:19
RandomGenerator::min
result_type min()
Definition: randomgenerator.h:24
RandomGenerator::generator
std::mt19937 * generator
Definition: randomgenerator.h:10
RandomGenerator::result_type
decltype((*generator)()) typedef result_type
Definition: randomgenerator.h:12
RandomGenerator::max
result_type max()
Definition: randomgenerator.h:29