Rudiments

randomnumber.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information.
3
4 #ifndef RUDIMENTS_RANDOMNUMBER_H
5 #define RUDIMENTS_RANDOMNUMBER_H
6
7 #include <rudiments/private/randomnumberincludes.h>
8
31 class RUDIMENTS_DLLSPEC randomnumber {
32 public:
33
35 randomnumber();
36
38 ~randomnumber();
39
41 bool setSeed(uint32_t seed);
42
48 bool generateNumber(uint32_t *result);
49
54 bool generateScaledNumber(int32_t lower,
55 int32_t upper,
56 int32_t *result);
57
61 static uint32_t getSeed();
62
68 static uint32_t generateNumber(uint32_t seed);
69
77 static int32_t generateScaledNumber(uint32_t seed,
78 int32_t lower,
79 int32_t upper);
80
86 static int32_t scaleNumber(uint32_t number,
87 int32_t lower,
88 int32_t upper);
89
94 static uint32_t getRandMax();
95
98 static bool needsMutex();
99
103 static void setMutex(threadmutex *mtx);
104
105 #include <rudiments/private/randomnumber.h>
106 };
107
108 #endif
randomnumber
Definition: randomnumber.h:31
randomnumber::setMutex
static void setMutex(threadmutex *mtx)
randomnumber::generateNumber
bool generateNumber(uint32_t *result)
randomnumber::generateNumber
static uint32_t generateNumber(uint32_t seed)
randomnumber::generateScaledNumber
bool generateScaledNumber(int32_t lower, int32_t upper, int32_t *result)
randomnumber::scaleNumber
static int32_t scaleNumber(uint32_t number, int32_t lower, int32_t upper)
randomnumber::~randomnumber
~randomnumber()
randomnumber::getRandMax
static uint32_t getRandMax()
randomnumber::needsMutex
static bool needsMutex()
randomnumber::randomnumber
randomnumber()
randomnumber::getSeed
static uint32_t getSeed()
randomnumber::setSeed
bool setSeed(uint32_t seed)
randomnumber::generateScaledNumber
static int32_t generateScaledNumber(uint32_t seed, int32_t lower, int32_t upper)
threadmutex
Definition: threadmutex.h:11