summaryrefslogtreecommitdiff
path: root/include/mbgl/style/layers/layer.hpp.ejs
diff options
context:
space:
mode:
authorMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-10-28 22:33:06 +0200
committerMikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com>2018-10-31 18:05:01 +0200
commitcfcb53128b41941a9cdacfec18d618b0866a96bc (patch)
tree27ee48ad45fca144d21f71673137c470bbb19459 /include/mbgl/style/layers/layer.hpp.ejs
parent278aa3370374154ad6fac7790d2da1546e8493f3 (diff)
downloadqtlocation-mapboxgl-cfcb53128b41941a9cdacfec18d618b0866a96bc.tar.gz
Introduce the style::Layer factory classes
This patch introduces the initial implementation of - A `LayerFactory` abstract class that creates `style::Layer` instances of a certain layer type (line, hillshade, round, ..) - A singleton `LayerManager` class, which is responsible for initializing the `LayerFactory` instances and forwarding the `create()` calls to the corresponding factory.
Diffstat (limited to 'include/mbgl/style/layers/layer.hpp.ejs')
-rw-r--r--include/mbgl/style/layers/layer.hpp.ejs8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs
index a5d4be14e6..b19b501713 100644
--- a/include/mbgl/style/layers/layer.hpp.ejs
+++ b/include/mbgl/style/layers/layer.hpp.ejs
@@ -72,5 +72,13 @@ protected:
Mutable<Layer::Impl> mutableBaseImpl() const final;
};
+class <%- camelize(type) %>LayerFactory : public LayerFactory {
+protected:
+ // LayerFactory overrides.
+ ~<%- camelize(type) %>LayerFactory() override;
+ const char* type() const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+};
+
} // namespace style
} // namespace mbgl