MCPcopy Create free account
hub / github.com/apache/trafficserver / Random

Class Random

include/tscore/Random.h:28–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace ts
27{
28class Random
29{
30public:
31 Random() = delete;
32
33 static uint64_t
34 random()
35 {
36 std::uniform_int_distribution<uint64_t> dist{0, UINT64_MAX};
37 return dist(_engine);
38 }
39
40 static double
41 drandom()
42 {
43 std::uniform_real_distribution<double> dist{0, 1};
44 return dist(_engine);
45 }
46
47 static void
48 seed(uint64_t s)
49 {
50 _engine.seed(s);
51 }
52
53private:
54 thread_local static std::mt19937_64 _engine;
55};
56}; // namespace ts

Callers 3

do_remapFunction · 0.85
do_remapFunction · 0.85
doRemapMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected