diff options
author | Konstantin Käfer <mail@kkaefer.com> | 2019-04-02 14:11:37 +0200 |
---|---|---|
committer | Konstantin Käfer <mail@kkaefer.com> | 2019-05-15 11:57:43 -0700 |
commit | da5bd4d6e3a0202cc4f9e4d3d17e159eb90acba6 (patch) | |
tree | 9450b28ea53804129de6cc049404bbef2b83778c /src/mbgl/util/id.cpp | |
parent | d5e7fabf455d3e8e6cb852fa544649c8012d70ed (diff) | |
download | qtlocation-mapboxgl-da5bd4d6e3a0202cc4f9e4d3d17e159eb90acba6.tar.gz |
[core] use unique IDs for DrawScopes
Diffstat (limited to 'src/mbgl/util/id.cpp')
-rw-r--r-- | src/mbgl/util/id.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mbgl/util/id.cpp b/src/mbgl/util/id.cpp new file mode 100644 index 0000000000..4486194de4 --- /dev/null +++ b/src/mbgl/util/id.cpp @@ -0,0 +1,14 @@ +#include <mbgl/util/id.hpp> + +#include <atomic> + +namespace mbgl { +namespace util { + +uint64_t nextID() { + static std::atomic<uint64_t> GUID { 0 }; + return GUID++; +} + +} // namespace util +} // namespace mbgl |