Public Member Functions | Protected Member Functions | Private Attributes

rand_rng::rng Class Reference

#include <rng.hpp>

Inheritance diagram for rand_rng::rng:
Inheritance graph
[legend]
Collaboration diagram for rand_rng::rng:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 rng ()
int get_random ()
 Get the next random number -- from the results if available, from the generator otherwise.
int get_random_nocheck ()
 Get the next random number.
const configget_random_results ()
void set_random_results (const config &cfg)
void set_seed (int seed)

Protected Member Functions

int get_random_private (bool check)
configrandom ()
void set_random (config *)

Private Attributes

configrandom_
size_t random_child_
simple_rng generator_

Detailed Description

Definition at line 29 of file rng.hpp.


Constructor & Destructor Documentation

rand_rng::rng::rng (  ) 

Definition at line 151 of file random.cpp.


Member Function Documentation

int rand_rng::rng::get_random (  ) 

Get the next random number -- from the results if available, from the generator otherwise.

The two should match.

Definition at line 155 of file random.cpp.

References get_random_private().

Here is the call graph for this function:

int rand_rng::rng::get_random_nocheck (  ) 

Get the next random number.

Do not check if the random number is consistent with local seed state (evantually this should be never used).

Definition at line 160 of file random.cpp.

References get_random_private().

Here is the call graph for this function:

int rand_rng::rng::get_random_private ( bool  check  )  [protected]

Definition at line 165 of file random.cpp.

References config::add_child(), config::child(), config::child_count(), ERR_RND, generator_, rand_rng::simple_rng::get_next_random(), LOG_RND, random_, and random_child_.

Referenced by get_random(), and get_random_nocheck().

Here is the call graph for this function:

Here is the caller graph for this function:

const config * rand_rng::rng::get_random_results (  ) 

Definition at line 196 of file random.cpp.

References config::child(), config::child_count(), random_, and random_child_.

Here is the call graph for this function:

config * rand_rng::rng::random (  )  [protected]

Definition at line 215 of file random.cpp.

References random_.

Referenced by replay::add_seed().

Here is the caller graph for this function:

void rand_rng::rng::set_random ( config random  )  [protected]

Definition at line 220 of file random.cpp.

References random_, and random_child_.

Referenced by replay::add_command(), replay::clear(), replay::get_next_action(), replay::pre_replay(), replay::set_to_end(), and replay::undo().

Here is the caller graph for this function:

void rand_rng::rng::set_random_results ( const config cfg  ) 

Definition at line 205 of file random.cpp.

References config::add_child(), config::child(), config::child_count(), config::clear_children(), random_, and random_child_.

Here is the call graph for this function:

void rand_rng::rng::set_seed ( int  seed  ) 

Definition at line 227 of file random.cpp.

References generator_, LOG_RND, and rand_rng::simple_rng::seed_random().

Referenced by do_gameloop().

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 60 of file rng.hpp.

Referenced by get_random_private(), and set_seed().

size_t rand_rng::rng::random_child_ [private]

Definition at line 58 of file rng.hpp.

Referenced by get_random_private(), get_random_results(), set_random(), and set_random_results().


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by doxygen 1.7.1 on Thu May 24 2012 01:25:27 for The Battle for Wesnoth
Gna! | Forum | Wiki | CIA | devdocs