diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-11-05 22:41:51 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-11-05 22:41:51 +0000 |
commit | ec05778d5718a7912e506764d443a78d6a6179e3 (patch) | |
tree | 78a9a01532180030c095acefc45763f07c14edb8 /src/stable/random.h | |
parent | b20414ac1fe80a71a90601f4cd1767fa7014a9ba (diff) | |
download | libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.gz libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.bz2 libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.tar.xz libbu++-ec05778d5718a7912e506764d443a78d6a6179e3.zip |
Converted tabs to spaces with tabconv.
Diffstat (limited to 'src/stable/random.h')
-rw-r--r-- | src/stable/random.h | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/src/stable/random.h b/src/stable/random.h index 43b8917..7989188 100644 --- a/src/stable/random.h +++ b/src/stable/random.h | |||
@@ -12,50 +12,50 @@ | |||
12 | 12 | ||
13 | namespace Bu | 13 | namespace Bu |
14 | { | 14 | { |
15 | class RandomBase; | 15 | class RandomBase; |
16 | class Random : public Bu::Singleton<Bu::Random> | 16 | class Random : public Bu::Singleton<Bu::Random> |
17 | { | 17 | { |
18 | friend class Bu::Singleton<Bu::Random>; | 18 | friend class Bu::Singleton<Bu::Random>; |
19 | private: | 19 | private: |
20 | Random(); | 20 | Random(); |
21 | virtual ~Random(); | 21 | virtual ~Random(); |
22 | 22 | ||
23 | public: | 23 | public: |
24 | template<typename cl> | 24 | template<typename cl> |
25 | static void setGenerator() | 25 | static void setGenerator() |
26 | { | 26 | { |
27 | delete getInstance().pGen; | 27 | delete getInstance().pGen; |
28 | getInstance().pGen = new cl(); | 28 | getInstance().pGen = new cl(); |
29 | } | 29 | } |
30 | 30 | ||
31 | template<typename cl, typename t1> | 31 | template<typename cl, typename t1> |
32 | static void setGenerator( t1 p1 ) | 32 | static void setGenerator( t1 p1 ) |
33 | { | 33 | { |
34 | delete getInstance().pGen; | 34 | delete getInstance().pGen; |
35 | getInstance().pGen = new cl( p1 ); | 35 | getInstance().pGen = new cl( p1 ); |
36 | } | 36 | } |
37 | 37 | ||
38 | template<typename cl, typename t1, typename t2> | 38 | template<typename cl, typename t1, typename t2> |
39 | static void setGenerator( t1 p1, t2 p2 ) | 39 | static void setGenerator( t1 p1, t2 p2 ) |
40 | { | 40 | { |
41 | delete getInstance().pGen; | 41 | delete getInstance().pGen; |
42 | getInstance().pGen = new cl( p1, p2 ); | 42 | getInstance().pGen = new cl( p1, p2 ); |
43 | } | 43 | } |
44 | 44 | ||
45 | RandomBase &getGenerator() { return *pGen; } | 45 | RandomBase &getGenerator() { return *pGen; } |
46 | 46 | ||
47 | static void seed( int32_t iSeed ); | 47 | static void seed( int32_t iSeed ); |
48 | static int32_t rand(); | 48 | static int32_t rand(); |
49 | static int32_t rand( int32_t iMax ); | 49 | static int32_t rand( int32_t iMax ); |
50 | static int32_t rand( int32_t iMin, int32_t iMax ); | 50 | static int32_t rand( int32_t iMin, int32_t iMax ); |
51 | static double randNorm(); | 51 | static double randNorm(); |
52 | 52 | ||
53 | private: | 53 | private: |
54 | void checkInit(); | 54 | void checkInit(); |
55 | 55 | ||
56 | private: | 56 | private: |
57 | Bu::RandomBase *pGen; | 57 | Bu::RandomBase *pGen; |
58 | }; | 58 | }; |
59 | }; | 59 | }; |
60 | 60 | ||
61 | #endif | 61 | #endif |