summaryrefslogtreecommitdiff
path: root/src/mbgl/util/id.cpp
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2019-04-02 14:11:37 +0200
committerKonstantin Käfer <mail@kkaefer.com>2019-05-15 11:57:43 -0700
commitda5bd4d6e3a0202cc4f9e4d3d17e159eb90acba6 (patch)
tree9450b28ea53804129de6cc049404bbef2b83778c /src/mbgl/util/id.cpp
parentd5e7fabf455d3e8e6cb852fa544649c8012d70ed (diff)
downloadqtlocation-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.cpp14
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