RAVENNAKIT
Loading...
Searching...
No Matches
rav::Random Class Reference

#include <random.hpp>

Public Member Functions

std::string generate_random_string (const size_t length)
 Generates alphanumeric random string.
template<typename T = int>
int get_random_int (T min, T max)
 Generates a random integer between min and max.
template<typename T = int>
std::chrono::milliseconds get_random_interval_ms (T min_ms, T max_ms)
 Generates a random interval between min_ms and max_ms with the granularity of one ms.

Detailed Description

Definition at line 34 of file random.hpp.

Member Function Documentation

◆ generate_random_string()

std::string rav::Random::generate_random_string ( const size_t length)
inline

Generates alphanumeric random string.

Parameters
lengthThe length of the string to generate.
Returns
The pseudo randomly generated string

Definition at line 41 of file random.hpp.

◆ get_random_int()

template<typename T = int>
int rav::Random::get_random_int ( T min,
T max )
inline

Generates a random integer between min and max.

Template Parameters
TThe type of the integer.
Parameters
minThe minimum value.
maxThe maximum value.
Returns
The pseudo randomly generated integer.

Definition at line 60 of file random.hpp.

◆ get_random_interval_ms()

template<typename T = int>
std::chrono::milliseconds rav::Random::get_random_interval_ms ( T min_ms,
T max_ms )
inline

Generates a random interval between min_ms and max_ms with the granularity of one ms.

Template Parameters
TThe type of the uniform_int_distribution IntType.
Parameters
min_msThe minimum value in milliseconds.
max_msThe maximum value in milliseconds.
Returns
The pseudo randomly generated interval.

Definition at line 73 of file random.hpp.


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