SPARK  0.1.0
A general purpose game engine written in C++.
Loading...
Searching...
No Matches
UuidGenerator.h
1#pragma once
2
3#include "spark/lib/Export.h"
4#include "spark/lib/Uuid.h"
5
6#include "spark/base/Macros.h"
7
8#include <random>
9
10namespace spark::lib
11{
15 class SPARK_LIB_EXPORT UuidGenerator final
16 {
17 public:
21 explicit UuidGenerator();
22
27 explicit UuidGenerator(uint64_t seed);
28
33 Uuid generate();
34
35 private:
36 SPARK_WARNING_PUSH
37 SPARK_DISABLE_MSVC_WARNING(4251)
38 /*
39 * class 'std::mt19937_64' needs to have dll-interface to be used by clients of class 'spark::base::UuidGenerator'
40 * class 'std::uniform_int_distribution<uint64_t>' needs to have dll-interface to be used by clients of class 'spark::base::UuidGenerator'
41 *
42 * This is a false positive, the class is not exported but is from the STL and the warning can be safely ignored.
43 */
44 std::mt19937_64 m_generator;
45 std::uniform_int_distribution<uint64_t> m_distribution;
46 SPARK_WARNING_POP
47 };
48}
Generates UUIDs from C++11 <random> module.
Definition UuidGenerator.h:16
A 128-bit universally unique identifier (UUID).
Definition Uuid.h:22