summaryrefslogtreecommitdiff
path: root/include/mbgl/style
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2017-04-04 11:33:22 -0700
committerJohn Firebaugh <john.firebaugh@gmail.com>2017-04-13 10:33:18 -0700
commit7b041b123cb067d247a727bb3a4563bb2fc575eb (patch)
treecdf9ce1583ef6cc3a16970a7ad9a1527521ecf41 /include/mbgl/style
parentde6c9b35f35f6ec0950529261b207d716c046beb (diff)
downloadqtlocation-mapboxgl-7b041b123cb067d247a727bb3a4563bb2fc575eb.tar.gz
[core, darwin] Object identity for MGLSource*, MGLStyleLayer*
All `MGLSource` pointers referencing the same logical source will now be object identical; similarly for `MGLStyleLayer`.
Diffstat (limited to 'include/mbgl/style')
-rw-r--r--include/mbgl/style/layer.hpp6
-rw-r--r--include/mbgl/style/source.hpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/include/mbgl/style/layer.hpp b/include/mbgl/style/layer.hpp
index 670faa8254..fa88b30dbc 100644
--- a/include/mbgl/style/layer.hpp
+++ b/include/mbgl/style/layer.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <mbgl/util/noncopyable.hpp>
+#include <mbgl/util/any.hpp>
#include <mbgl/style/types.hpp>
#include <memory>
@@ -118,6 +119,11 @@ public:
// Private implementation
const std::unique_ptr<Impl> baseImpl;
+ // For use in SDK bindings, which store a reference to a platform-native peer
+ // object here, so that separately-obtained references to this object share
+ // identical platform-native peers.
+ any peer;
+
friend std::string layoutKey(const Layer&);
};
diff --git a/include/mbgl/style/source.hpp b/include/mbgl/style/source.hpp
index 0e6e32b112..f2dfb6a896 100644
--- a/include/mbgl/style/source.hpp
+++ b/include/mbgl/style/source.hpp
@@ -4,6 +4,7 @@
#include <mbgl/util/noncopyable.hpp>
#include <mbgl/util/optional.hpp>
#include <mbgl/util/range.hpp>
+#include <mbgl/util/any.hpp>
#include <mbgl/style/types.hpp>
#include <mbgl/style/query.hpp>
@@ -64,6 +65,11 @@ public:
class Impl;
const std::unique_ptr<Impl> baseImpl;
+ // For use in SDK bindings, which store a reference to a platform-native peer
+ // object here, so that separately-obtained references to this object share
+ // identical platform-native peers.
+ any peer;
+
protected:
const SourceType type;
Source(SourceType, std::unique_ptr<Impl>);