Symphony Of Empires
Eng3D::Rand Class Reference

Thread safe random number generator. More...

#include <rand.hpp>

Public Types

using result_type = uint32_t
 

Public Member Functions

constexpr Rand ()=default
 
 Rand (uint32_t seed)
 
constexpr Rand (Rand const &o) noexcept
 
constexpr Rand (Rand &&o) noexcept
 
constexpr uint32_t operator() ()
 
template<int32_t n>
constexpr void advance_n ()
 
Randoperator= (Rand const &) noexcept=default
 
Randoperator= (Rand &&) noexcept=default
 

Static Public Member Functions

constexpr static uint32_t max ()
 Obtains the maximum generable number. More...
 
constexpr static uint32_t min ()
 Obtains the minimum generable number. More...
 

Static Public Attributes

constexpr static uint32_t initial_seed = 0xf1ea5eed
 

Detailed Description

Thread safe random number generator.

Definition at line 34 of file rand.hpp.

Member Typedef Documentation

◆ result_type

using Eng3D::Rand::result_type = uint32_t

Definition at line 37 of file rand.hpp.

Constructor & Destructor Documentation

◆ Rand() [1/4]

constexpr Eng3D::Rand::Rand ( )
constexprdefault

◆ Rand() [2/4]

Eng3D::Rand::Rand ( uint32_t  seed)
inline

Definition at line 42 of file rand.hpp.

◆ Rand() [3/4]

constexpr Eng3D::Rand::Rand ( Rand const &  o)
inlineconstexprnoexcept

Definition at line 49 of file rand.hpp.

◆ Rand() [4/4]

constexpr Eng3D::Rand::Rand ( Rand &&  o)
inlineconstexprnoexcept

Definition at line 58 of file rand.hpp.

Member Function Documentation

◆ advance_n()

template<int32_t n>
constexpr void Eng3D::Rand::advance_n ( )
inlineconstexpr

Definition at line 89 of file rand.hpp.

◆ max()

constexpr static uint32_t Eng3D::Rand::max ( )
inlinestaticconstexpr

Obtains the maximum generable number.

Returns
constexpr uint32_t

Definition at line 69 of file rand.hpp.

◆ min()

constexpr static uint32_t Eng3D::Rand::min ( )
inlinestaticconstexpr

Obtains the minimum generable number.

Returns
constexpr uint32_t

Definition at line 75 of file rand.hpp.

◆ operator()()

constexpr uint32_t Eng3D::Rand::operator() ( )
inlineconstexpr

Definition at line 79 of file rand.hpp.

◆ operator=() [1/2]

Rand& Eng3D::Rand::operator= ( Rand &&  )
defaultnoexcept

◆ operator=() [2/2]

Rand& Eng3D::Rand::operator= ( Rand const &  )
defaultnoexcept

Member Data Documentation

◆ initial_seed

constexpr static uint32_t Eng3D::Rand::initial_seed = 0xf1ea5eed
staticconstexpr

Definition at line 38 of file rand.hpp.


The documentation for this class was generated from the following file: