mn::IPseudoRandomUtil< TSEEDTYPE > Class Template Referenceabstract

An Intarface for all randoms classes in this library. More...

#include <mn_random.hpp>

Classes

union  convers
 Union for type convertion. More...
 

Public Types

using seed_t = TSEEDTYPE
 
using result_type = TSEEDTYPE
 

Public Member Functions

 IPseudoRandomUtil (seed_t startSeed)
 Construct a new IPseudoRandomUtil object. More...
 
virtual unsigned char rand8 ()=0
 Get a random unsigned char number. More...
 
virtual unsigned short rand16 ()=0
 Get a random unsigned short number. More...
 
virtual unsigned int rand32 ()=0
 Get a random unsigned int number. More...
 
virtual seed_t get_seed ()
 Get the current used Seed. More...
 
virtual void set_seed (seed_t seed)
 Set the a new seed. More...
 
result_type operator() (bool b=true) const noexcept
 
result_type min ()
 
result_type max ()
 

Protected Attributes

seed_t m_startSeed
 

Detailed Description

template<typename TSEEDTYPE>
class mn::IPseudoRandomUtil< TSEEDTYPE >

An Intarface for all randoms classes in this library.

Author
Amber-Sophia Schröck
Template Parameters
TSEEDTYPESeed Type

Class Documentation

◆ mn::IPseudoRandomUtil::convers

union mn::IPseudoRandomUtil::convers

template<typename TSEEDTYPE>
union mn::IPseudoRandomUtil< TSEEDTYPE >::convers

Union for type convertion.

Class Members
unsigned char g[4]
unsigned short g16[2]
unsigned int g32

Member Typedef Documentation

◆ result_type

template<typename TSEEDTYPE >
using mn::IPseudoRandomUtil< TSEEDTYPE >::result_type = TSEEDTYPE

◆ seed_t

template<typename TSEEDTYPE >
using mn::IPseudoRandomUtil< TSEEDTYPE >::seed_t = TSEEDTYPE

Constructor & Destructor Documentation

◆ IPseudoRandomUtil()

template<typename TSEEDTYPE >
mn::IPseudoRandomUtil< TSEEDTYPE >::IPseudoRandomUtil ( seed_t  startSeed)
inline

Construct a new IPseudoRandomUtil object.

Parameters
startSeedThe start seed

Member Function Documentation

◆ get_seed()

template<typename TSEEDTYPE >
virtual seed_t mn::IPseudoRandomUtil< TSEEDTYPE >::get_seed ( )
inlinevirtual

Get the current used Seed.

Returns
The current used Seed

Reimplemented in mn::basic_ramdom_xorshift.

◆ max()

template<typename TSEEDTYPE >
result_type mn::IPseudoRandomUtil< TSEEDTYPE >::max ( )
inline

◆ min()

template<typename TSEEDTYPE >
result_type mn::IPseudoRandomUtil< TSEEDTYPE >::min ( )
inline

◆ operator()()

template<typename TSEEDTYPE >
result_type mn::IPseudoRandomUtil< TSEEDTYPE >::operator() ( bool  b = true) const
inlinenoexcept

◆ rand16()

template<typename TSEEDTYPE >
virtual unsigned short mn::IPseudoRandomUtil< TSEEDTYPE >::rand16 ( )
pure virtual

Get a random unsigned short number.

Returns
A random unsigned short number

Implemented in mn::basic_random_lfsr, and mn::basic_ramdom_xorshift.

◆ rand32()

template<typename TSEEDTYPE >
virtual unsigned int mn::IPseudoRandomUtil< TSEEDTYPE >::rand32 ( )
pure virtual

Get a random unsigned int number.

Returns
A random unsigned int number

Implemented in mn::basic_random_lfsr, and mn::basic_ramdom_xorshift.

◆ rand8()

template<typename TSEEDTYPE >
virtual unsigned char mn::IPseudoRandomUtil< TSEEDTYPE >::rand8 ( )
pure virtual

Get a random unsigned char number.

Returns
A random unsigned char number

Implemented in mn::basic_random_lfsr, and mn::basic_ramdom_xorshift.

◆ set_seed()

template<typename TSEEDTYPE >
virtual void mn::IPseudoRandomUtil< TSEEDTYPE >::set_seed ( seed_t  seed)
inlinevirtual

Set the a new seed.

Parameters
seedTde new used seed

Reimplemented in mn::basic_ramdom_xorshift.

Member Data Documentation

◆ m_startSeed

template<typename TSEEDTYPE >
seed_t mn::IPseudoRandomUtil< TSEEDTYPE >::m_startSeed
protected

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