chaos Class Reference

a platform-independent way to acquire random numbers in a specific range. More...

#include <chaos.h>

Inheritance diagram for chaos:

Inheritance graph
[legend]
Collaboration diagram for chaos:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 chaos ()
 constructs a random number generator. does not retrain random seed.
 IMPLEMENT_CLASS_NAME ("chaos")
void retrain ()
 Scrambles the OS's random seed and then provides pseudo-random values.
int inclusive (int low, int high) const
 Returns a pseudo-random number r, such that "low" <= r <= "high".
int exclusive (int low, int high) const
 Returns a pseudo-random number r, such that "low" < r < "high".

Detailed Description

a platform-independent way to acquire random numbers in a specific range.

This object also re-seeds the underlying system's random seed when retrain() is invoked.

Definition at line 26 of file chaos.h.


Constructor & Destructor Documentation

chaos::chaos (  ) 

constructs a random number generator. does not retrain random seed.

Definition at line 35 of file chaos.cpp.


Member Function Documentation

chaos::IMPLEMENT_CLASS_NAME ( "chaos"   ) 

void chaos::retrain (  ) 

Scrambles the OS's random seed and then provides pseudo-random values.

Definition at line 37 of file chaos.cpp.

References LOG, and portable::system_uptime().

int chaos::inclusive ( int  low,
int  high 
) const

Returns a pseudo-random number r, such that "low" <= r <= "high".

Definition at line 64 of file chaos.cpp.

References GET_RAND.

Referenced by hamming::corrupter(), ice_key::encrypt(), formal(), generate_key(), hamming::init_lower_subnet(), hamming::init_upper_subnet(), hamming::init_with_unknown_pattern(), octopus::issue_identity(), istring_sprintf_test(), main(), spocket_tester::perform_test(), broadcast_spocket_tester::perform_test(), nechung_oracle::pick_random(), portable::query_for_process_info(), ssl_init::random_bytes(), random_reposition(), random_seed(), octopus_request_id::randomized_id(), run_test_14(), run_test_32(), run_test_34(), SAFE_STATIC_CONST(), shuffle_list(), standard_sprintf_test(), test_amorph_of(), test_bogon_amorph(), test_byte_array_amorph(), test_recursive_locking(), test_stack_with_objects(), and test_stack_with_pointers().

int chaos::exclusive ( int  low,
int  high 
) const

Returns a pseudo-random number r, such that "low" < r < "high".

Definition at line 73 of file chaos.cpp.

References GET_RAND.


The documentation for this class was generated from the following files:
Generated on Fri Nov 28 04:30:39 2008 for HOOPLE Libraries by  doxygen 1.5.1