summaryrefslogtreecommitdiff
path: root/src/mbgl/style/layer_impl.hpp
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-11-22 15:37:09 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-11-27 18:10:21 +0200
commit361982fef83a145769da5c04d1c19731df89921c (patch)
treee6212cb782cf9df83ecc3e32cb52beaebeb73ab8 /src/mbgl/style/layer_impl.hpp
parentcca37e765bf9b853262783a6f7cc3d1a4c72957d (diff)
downloadqtlocation-mapboxgl-361982fef83a145769da5c04d1c19731df89921c.tar.gz
[core][Android][Darwin] LayerManager creates RenderLayer instances
`LayerManager` is now responsible for `RenderLayer` instances creation, so that there is a single entry point for creating of objects, which correspond to a certain layer type. The `LayerType type` field is dropped from `Layer::Impl`.
Diffstat (limited to 'src/mbgl/style/layer_impl.hpp')
-rw-r--r--src/mbgl/style/layer_impl.hpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mbgl/style/layer_impl.hpp b/src/mbgl/style/layer_impl.hpp
index 948bbab619..c64173600e 100644
--- a/src/mbgl/style/layer_impl.hpp
+++ b/src/mbgl/style/layer_impl.hpp
@@ -29,7 +29,7 @@ namespace style {
*/
class Layer::Impl {
public:
- Impl(LayerType, std::string layerID, std::string sourceID);
+ Impl(std::string layerID, std::string sourceID);
virtual ~Impl() = default;
Impl& operator=(const Impl&) = delete;
@@ -47,8 +47,6 @@ public:
// Populates the given \a fontStack with fonts being used by the layer.
virtual void populateFontStack(std::set<FontStack>& fontStack) const;
- // Note: LayerType is deprecated, do not use it.
- const LayerType type;
std::string id;
std::string source;
std::string sourceLayer;
@@ -61,5 +59,10 @@ protected:
Impl(const Impl&) = default;
};
+// To be used in the inherited classes.
+#define DECLARE_LAYER_TYPE_INFO \
+const LayerTypeInfo* getTypeInfo() const noexcept final { return staticTypeInfo(); } \
+static const LayerTypeInfo* staticTypeInfo() noexcept
+
} // namespace style
-} // namespace mbgl
+} // namespace mbgl \ No newline at end of file