Rudiments

- Main Page
- Classes

randomnumber.h
1 // Copyright (c) 1999-2002 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
9 class randomnumberprivate;
10
33 class RUDIMENTS_DLLSPEC randomnumber {
34 public:
35
37 randomnumber();
38
40 ~randomnumber();
41
43 bool setSeed(uint32_t seed);
44
50 bool generateNumber(uint32_t *result);
51
56 bool generateScaledNumber(int32_t lower,
57 int32_t upper,
58 int32_t *result);
59
63 static uint32_t getSeed();
64
70 static uint32_t generateNumber(uint32_t seed);
71
79 static int32_t generateScaledNumber(uint32_t seed,
80 int32_t lower,
81 int32_t upper);
82
88 static int32_t scaleNumber(uint32_t number,
89 int32_t lower,
90 int32_t upper);
91
96 static uint32_t getRandMax();
97
100 static bool needsMutex();
101
105 static void setMutex(threadmutex *mtx);
106
107 #include <rudiments/private/randomnumber.h>
108 };
109
110 #endif
threadmutex
Definition: threadmutex.h:13
randomnumber
Definition: randomnumber.h:33