iFun Engine API  1.0.0-b6053
Great Technology for Great Games
Static Public Member Functions | List of all members
fun::RandomGenerator Class Reference

Utility singleton component to generate random values of various types, including number, string, UUID and etc. More...

#include <random_generator.h>

Static Public Member Functions

static string GenerateAlphanumeric (size_t min_length, size_t max_length)
 Generates a random alphanumeric string, string length in range [min_length, max_length](max also inclusive). More...
 
static int64_t GenerateNumber (int64_t min, int64_t max)
 Generates a random number, in range of [min, max](max also inclusive). More...
 
static Uuid GenerateUuid ()
 Generates a random UUID, using boost::uuids::random_generator. More...
 

Detailed Description

Thread-safe using boost::mutex.

Member Function Documentation

◆ GenerateAlphanumeric()

static string fun::RandomGenerator::GenerateAlphanumeric ( size_t  min_length,
size_t  max_length 
)
static
Parameters
min_lengthMin value of string length(inclusive).
max_lengthMax value of string length(inclusive).
Returns
A newly generated random alphanumeric string.

◆ GenerateNumber()

static int64_t fun::RandomGenerator::GenerateNumber ( int64_t  min,
int64_t  max 
)
static
Parameters
minMin value(inclusive).
maxMax value(inclusive).
Returns
A newly generated random number.

◆ GenerateUuid()

static Uuid fun::RandomGenerator::GenerateUuid ( )
static
Returns
A newly generated random UUID.