00001 #ifndef _RANDOM_H
00002 #define _RANDOM_H
00003 namespace osl
00004 {
00005 namespace misc
00006 {
00007 unsigned int random();
00008 unsigned int time_seeded_random();
00009 template<typename T>
00010 struct Random;
00011 template<>
00012 struct Random<unsigned int>{
00013 static unsigned int newValue(){
00014 return random();
00015 }
00016 };
00017 template<>
00018 struct Random<unsigned long long>{
00019 static unsigned long long newValue(){
00020 return (static_cast<unsigned long long>(random())<<32ull)|
00021 static_cast<unsigned long long>(random());
00022 }
00023 };
00024 }
00025 using osl::misc::random;
00026 using osl::misc::time_seeded_random;
00027 }
00028 #endif
00029
00030
00031
00032