random.h
Go to the documentation of this file.
#ifndef OSL_RANDOM_H
#define OSL_RANDOM_H
namespace osl
{
namespace misc
{
unsigned int random();
unsigned int time_seeded_random();
template<typename T>
struct Random;
template<>
struct Random<unsigned int>{
static unsigned int newValue(){
return random();
}
};
template<>
struct Random<unsigned long long>{
static unsigned long long newValue(){
return (static_cast<unsigned long long>(random())<<32ull)|
static_cast<unsigned long long>(random());
}
};
} // namespace misc
using osl::misc::random;
using osl::misc::time_seeded_random;
} // namespace osl
#endif /* _RANDOM_H */
// ;;; Local Variables:
// ;;; mode:c++
// ;;; c-basic-offset:2
// ;;; End:
osl::misc
Definition basic_type.h:66
osl::misc::time_seeded_random
unsigned int time_seeded_random()
Definition random.cc:10
osl::misc::random
unsigned int random()
Definition random.cc:4
osl
Definition additionalEffect.h:6
osl::misc::Random< unsigned int >::newValue
static unsigned int newValue()
Definition random.h:13
osl::misc::Random< unsigned long long >::newValue
static unsigned long long newValue()
Definition random.h:19
osl::misc::Random
Definition random.h:10