MT Core (C++)
Core library for replacing C++ standard in project usage
Loading...
Searching...
No Matches
mtcore::PrngVTable Struct Reference

V-Table for PRNG Designed for having a simple PRNG implementation. More...

#include <random.hpp>

Collaboration diagram for mtcore::PrngVTable:

Public Attributes

uint64_t(* nextUint )(PrngState &self)
 Optional Gets the next unsigned int.
 
double(* next1_0 )(PrngState &self)
 Optional Gets a double d, such that 0 <= d < 1.
 
Result< void, SeedError >(* seed )(PrngState &self, uint64_t seed)
 Optional Re-seeds the PRNG.
 
void(* deinit )(PrngState &self)
 Optional Deinitializes the PRNG and frees up any allocated state The PRNG is NOT safe to use after calling deinit!
 

Detailed Description

V-Table for PRNG Designed for having a simple PRNG implementation.

For in_range methods to work, at least one of nextUint or next1_0 must be provided For nextUInt and next1_0 to work, need to provide nextUint and next1_0

It's recommended to provide both nextUint and next1_0, but for very simple applications with simple (and consistent) lack of needing both, you can provide only one

Definition at line 69 of file random.hpp.

Member Data Documentation

◆ deinit

void(* mtcore::PrngVTable::deinit) (PrngState &self)

Optional Deinitializes the PRNG and frees up any allocated state The PRNG is NOT safe to use after calling deinit!

Definition at line 93 of file random.hpp.

◆ next1_0

double(* mtcore::PrngVTable::next1_0) (PrngState &self)

Optional Gets a double d, such that 0 <= d < 1.

Definition at line 80 of file random.hpp.

◆ nextUint

uint64_t(* mtcore::PrngVTable::nextUint) (PrngState &self)

Optional Gets the next unsigned int.

Definition at line 74 of file random.hpp.

◆ seed

Result< void, SeedError >(* mtcore::PrngVTable::seed) (PrngState &self, uint64_t seed)

Optional Re-seeds the PRNG.

Definition at line 80 of file random.hpp.


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