From ff09c94d0825f5dbe7dddce52b64e74d61978976 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Thu, 15 Nov 2018 15:47:25 +0200 Subject: [core][android] Introduce mbgl::style::LayerTypeInfo The `LayerTypeInfo` contains static meta data about certain layer type. Each layer module should have a single immutable `LayerTypeInfo` instance for the represented layer type. Both `LayerImpl` and `LayerFactory` from the module always refer to the same `LayerTypeInfo` instance, so address of this instance can be used as a layer module Id during the process life time. --- include/mbgl/style/layers/line_layer.hpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'include/mbgl/style/layers/line_layer.hpp') diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp index 26837f4d06..0f5e2bb347 100644 --- a/include/mbgl/style/layers/line_layer.hpp +++ b/include/mbgl/style/layers/line_layer.hpp @@ -128,15 +128,11 @@ protected: class LineLayerFactory : public LayerFactory { public: LineLayerFactory(); - // LayerFactory overrides. ~LineLayerFactory() override; - bool supportsType(const std::string& type) const noexcept final; - std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - - static LineLayerFactory* get() noexcept; -private: - static LineLayerFactory* instance; + // LayerFactory overrides. + const LayerTypeInfo* getTypeInfo() const noexcept final; + std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; }; } // namespace style -- cgit v1.2.1