MongoDB C++ Driver  legacy-1.1.2
Public Member Functions | List of all members
mongo::PseudoRandom Class Reference

Uses http://en.wikipedia.org/wiki/Xorshift. More...

#include <random.h>

Public Member Functions

int32_t nextInt32 (int32_t max)
 
int64_t nextInt64 (int64_t max)
 
intptr_t operator() (intptr_t max)
 

Detailed Description

Uses http://en.wikipedia.org/wiki/Xorshift.

Member Function Documentation

int32_t mongo::PseudoRandom::nextInt32 ( int32_t  max)
inline
Returns
a number between 0 and max
int64_t mongo::PseudoRandom::nextInt64 ( int64_t  max)
inline
Returns
a number between 0 and max
intptr_t mongo::PseudoRandom::operator() ( intptr_t  max)
inline
Returns
a number between 0 and max

This makes PseudoRandom instances passable as the third argument to std::random_shuffle


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