The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
random_new::synced_rng Class Reference

#include <random_new_synced.hpp>

Inheritance diagram for random_new::synced_rng:
Inheritance graph

Public Member Functions

 synced_rng (std::function< std::string()> seed_generator)
 
virtual ~synced_rng ()
 
- Public Member Functions inherited from random_new::rng
 rng ()
 
uint32_t next_random ()
 Provides the next random draw. More...
 
virtual ~rng ()
 
unsigned int get_random_calls ()
 Provides the number of random calls to the rng in this context. More...
 
int get_random_int (int min, int max)
 
This helper method provides a random int from the underlying generator,

using results of next_random in a manner guaranteed to be cross platform. More...

 

Protected Member Functions

virtual uint32_t next_random_impl ()
 

Private Member Functions

void initialize ()
 

Private Attributes

bool has_valid_seed_
 
std::function< std::string()> seed_generator_
 
rand_rng::mt_rng gen_
 

Additional Inherited Members

- Static Public Member Functions inherited from random_new::rng
static rngdefault_instance ()
 
- Protected Attributes inherited from random_new::rng
unsigned int random_calls_
 

Detailed Description

Definition at line 28 of file random_new_synced.hpp.

Constructor & Destructor Documentation

random_new::synced_rng::synced_rng ( std::function< std::string()>  seed_generator)

Definition at line 25 of file random_new_synced.cpp.

random_new::synced_rng::~synced_rng ( )
virtual

Definition at line 49 of file random_new_synced.cpp.

Member Function Documentation

void random_new::synced_rng::initialize ( )
private
uint32_t random_new::synced_rng::next_random_impl ( )
protectedvirtual

Member Data Documentation

rand_rng::mt_rng random_new::synced_rng::gen_
private

Definition at line 40 of file random_new_synced.hpp.

Referenced by initialize(), and next_random_impl().

bool random_new::synced_rng::has_valid_seed_
private

Definition at line 38 of file random_new_synced.hpp.

Referenced by initialize(), and next_random_impl().

std::function<std::string()> random_new::synced_rng::seed_generator_
private

Definition at line 39 of file random_new_synced.hpp.

Referenced by initialize().


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