summaryrefslogtreecommitdiff
path: root/include/mbgl/style/layers
diff options
context:
space:
mode:
Diffstat (limited to 'include/mbgl/style/layers')
-rw-r--r--include/mbgl/style/layers/background_layer.hpp12
-rw-r--r--include/mbgl/style/layers/circle_layer.hpp12
-rw-r--r--include/mbgl/style/layers/custom_layer.hpp14
-rw-r--r--include/mbgl/style/layers/fill_extrusion_layer.hpp12
-rw-r--r--include/mbgl/style/layers/fill_layer.hpp12
-rw-r--r--include/mbgl/style/layers/heatmap_layer.hpp12
-rw-r--r--include/mbgl/style/layers/hillshade_layer.hpp12
-rw-r--r--include/mbgl/style/layers/layer.hpp.ejs12
-rw-r--r--include/mbgl/style/layers/line_layer.hpp12
-rw-r--r--include/mbgl/style/layers/raster_layer.hpp12
-rw-r--r--include/mbgl/style/layers/symbol_layer.hpp12
11 files changed, 104 insertions, 30 deletions
diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp
index 989ef54b21..61e95d2273 100644
--- a/include/mbgl/style/layers/background_layer.hpp
+++ b/include/mbgl/style/layers/background_layer.hpp
@@ -57,11 +57,17 @@ protected:
};
class BackgroundLayerFactory : public LayerFactory {
-protected:
+public:
+ BackgroundLayerFactory();
// LayerFactory overrides.
~BackgroundLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static BackgroundLayerFactory* get();
+
+private:
+ static BackgroundLayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp
index dd22275b85..92a6bbd92e 100644
--- a/include/mbgl/style/layers/circle_layer.hpp
+++ b/include/mbgl/style/layers/circle_layer.hpp
@@ -105,11 +105,17 @@ protected:
};
class CircleLayerFactory : public LayerFactory {
-protected:
+public:
+ CircleLayerFactory();
// LayerFactory overrides.
~CircleLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static CircleLayerFactory* get();
+
+private:
+ static CircleLayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/custom_layer.hpp b/include/mbgl/style/layers/custom_layer.hpp
index 4ae59dfae3..f58e41adf5 100644
--- a/include/mbgl/style/layers/custom_layer.hpp
+++ b/include/mbgl/style/layers/custom_layer.hpp
@@ -85,5 +85,19 @@ public:
Mutable<Layer::Impl> mutableBaseImpl() const final;
};
+class CustomLayerFactory : public LayerFactory {
+public:
+ CustomLayerFactory();
+ // LayerFactory overrides.
+ ~CustomLayerFactory() override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static CustomLayerFactory* get();
+
+private:
+ static CustomLayerFactory* instance;
+};
+
} // namespace style
} // namespace mbgl
diff --git a/include/mbgl/style/layers/fill_extrusion_layer.hpp b/include/mbgl/style/layers/fill_extrusion_layer.hpp
index fcc66e782b..bc761f2bec 100644
--- a/include/mbgl/style/layers/fill_extrusion_layer.hpp
+++ b/include/mbgl/style/layers/fill_extrusion_layer.hpp
@@ -81,11 +81,17 @@ protected:
};
class FillExtrusionLayerFactory : public LayerFactory {
-protected:
+public:
+ FillExtrusionLayerFactory();
// LayerFactory overrides.
~FillExtrusionLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static FillExtrusionLayerFactory* get();
+
+private:
+ static FillExtrusionLayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp
index 0c36435ffc..7ef6727691 100644
--- a/include/mbgl/style/layers/fill_layer.hpp
+++ b/include/mbgl/style/layers/fill_layer.hpp
@@ -81,11 +81,17 @@ protected:
};
class FillLayerFactory : public LayerFactory {
-protected:
+public:
+ FillLayerFactory();
// LayerFactory overrides.
~FillLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static FillLayerFactory* get();
+
+private:
+ static FillLayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/heatmap_layer.hpp b/include/mbgl/style/layers/heatmap_layer.hpp
index 3f53877523..e38c6ab6e1 100644
--- a/include/mbgl/style/layers/heatmap_layer.hpp
+++ b/include/mbgl/style/layers/heatmap_layer.hpp
@@ -70,11 +70,17 @@ protected:
};
class HeatmapLayerFactory : public LayerFactory {
-protected:
+public:
+ HeatmapLayerFactory();
// LayerFactory overrides.
~HeatmapLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static HeatmapLayerFactory* get();
+
+private:
+ static HeatmapLayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/hillshade_layer.hpp b/include/mbgl/style/layers/hillshade_layer.hpp
index 3227505f5d..e1e9a4d0a1 100644
--- a/include/mbgl/style/layers/hillshade_layer.hpp
+++ b/include/mbgl/style/layers/hillshade_layer.hpp
@@ -75,11 +75,17 @@ protected:
};
class HillshadeLayerFactory : public LayerFactory {
-protected:
+public:
+ HillshadeLayerFactory();
// LayerFactory overrides.
~HillshadeLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static HillshadeLayerFactory* get();
+
+private:
+ static HillshadeLayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs
index b19b501713..6006352eee 100644
--- a/include/mbgl/style/layers/layer.hpp.ejs
+++ b/include/mbgl/style/layers/layer.hpp.ejs
@@ -73,11 +73,17 @@ protected:
};
class <%- camelize(type) %>LayerFactory : public LayerFactory {
-protected:
+public:
+ <%- camelize(type) %>LayerFactory();
// 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;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static <%- camelize(type) %>LayerFactory* get();
+
+private:
+ static <%- camelize(type) %>LayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp
index 62cca8215d..de1ed8eef1 100644
--- a/include/mbgl/style/layers/line_layer.hpp
+++ b/include/mbgl/style/layers/line_layer.hpp
@@ -126,11 +126,17 @@ protected:
};
class LineLayerFactory : public LayerFactory {
-protected:
+public:
+ LineLayerFactory();
// LayerFactory overrides.
~LineLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static LineLayerFactory* get();
+
+private:
+ static LineLayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp
index 27057c6af7..5cf06a7d98 100644
--- a/include/mbgl/style/layers/raster_layer.hpp
+++ b/include/mbgl/style/layers/raster_layer.hpp
@@ -87,11 +87,17 @@ protected:
};
class RasterLayerFactory : public LayerFactory {
-protected:
+public:
+ RasterLayerFactory();
// LayerFactory overrides.
~RasterLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static RasterLayerFactory* get();
+
+private:
+ static RasterLayerFactory* instance;
};
} // namespace style
diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp
index 6c0ec6ca6e..5dac5925dd 100644
--- a/include/mbgl/style/layers/symbol_layer.hpp
+++ b/include/mbgl/style/layers/symbol_layer.hpp
@@ -275,11 +275,17 @@ protected:
};
class SymbolLayerFactory : public LayerFactory {
-protected:
+public:
+ SymbolLayerFactory();
// LayerFactory overrides.
~SymbolLayerFactory() override;
- const char* type() const final;
- std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) override;
+ bool supportsType(const std::string& type) const final;
+ std::unique_ptr<style::Layer> createLayer(const std::string& id, const conversion::Convertible& value) final;
+
+ static SymbolLayerFactory* get();
+
+private:
+ static SymbolLayerFactory* instance;
};
} // namespace style