From 5a70f2b15081bede66a2d736dc3e8f90ba73d601 Mon Sep 17 00:00:00 2001 From: Mikhail Pozdnyakov Date: Tue, 6 Nov 2018 16:48:18 +0200 Subject: noexcept specifier for layer factory methods --- include/mbgl/style/layer.hpp | 10 +++++----- include/mbgl/style/layers/background_layer.hpp | 4 ++-- include/mbgl/style/layers/circle_layer.hpp | 4 ++-- include/mbgl/style/layers/custom_layer.hpp | 4 ++-- include/mbgl/style/layers/fill_extrusion_layer.hpp | 4 ++-- include/mbgl/style/layers/fill_layer.hpp | 4 ++-- include/mbgl/style/layers/heatmap_layer.hpp | 4 ++-- include/mbgl/style/layers/hillshade_layer.hpp | 4 ++-- include/mbgl/style/layers/layer.hpp.ejs | 4 ++-- include/mbgl/style/layers/line_layer.hpp | 4 ++-- include/mbgl/style/layers/raster_layer.hpp | 4 ++-- include/mbgl/style/layers/symbol_layer.hpp | 4 ++-- platform/android/src/style/layers/layer_manager.cpp | 6 +++--- platform/android/src/style/layers/layer_manager.hpp | 4 ++-- platform/default/layer_manager.cpp | 9 ++++++--- src/mbgl/style/layer.cpp | 4 ++-- src/mbgl/style/layer_impl.hpp | 2 +- src/mbgl/style/layers/background_layer.cpp | 6 +++--- src/mbgl/style/layers/background_layer_impl.hpp | 2 +- src/mbgl/style/layers/circle_layer.cpp | 6 +++--- src/mbgl/style/layers/circle_layer_impl.hpp | 2 +- src/mbgl/style/layers/custom_layer.cpp | 4 ++-- src/mbgl/style/layers/custom_layer_impl.cpp | 2 +- src/mbgl/style/layers/custom_layer_impl.hpp | 2 +- src/mbgl/style/layers/fill_extrusion_layer.cpp | 6 +++--- src/mbgl/style/layers/fill_extrusion_layer_impl.hpp | 2 +- src/mbgl/style/layers/fill_layer.cpp | 6 +++--- src/mbgl/style/layers/fill_layer_impl.hpp | 2 +- src/mbgl/style/layers/heatmap_layer.cpp | 6 +++--- src/mbgl/style/layers/heatmap_layer_impl.hpp | 2 +- src/mbgl/style/layers/hillshade_layer.cpp | 6 +++--- src/mbgl/style/layers/hillshade_layer_impl.hpp | 2 +- src/mbgl/style/layers/layer.cpp.ejs | 6 +++--- src/mbgl/style/layers/line_layer.cpp | 6 +++--- src/mbgl/style/layers/line_layer_impl.hpp | 2 +- src/mbgl/style/layers/raster_layer.cpp | 6 +++--- src/mbgl/style/layers/raster_layer_impl.hpp | 2 +- src/mbgl/style/layers/symbol_layer.cpp | 6 +++--- src/mbgl/style/layers/symbol_layer_impl.hpp | 2 +- 39 files changed, 84 insertions(+), 81 deletions(-) diff --git a/include/mbgl/style/layer.hpp b/include/mbgl/style/layer.hpp index c2aaaa6f48..1e1e97dd0d 100644 --- a/include/mbgl/style/layer.hpp +++ b/include/mbgl/style/layer.hpp @@ -98,13 +98,13 @@ class LayerFactory { public: virtual ~LayerFactory() = default; /// Returns \c true if this factory can produce layers of the given type of the layers; returns \c false otherwise. - virtual bool supportsType(const std::string& type) const = 0; + virtual bool supportsType(const std::string& type) const noexcept = 0; /// Returns a new Layer instance on success call; returns `nulltptr` otherwise. virtual std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) = 0; protected: - optional getSource(const conversion::Convertible& value) const; - bool initSourceLayerAndFilter(Layer*, const conversion::Convertible& value) const; + optional getSource(const conversion::Convertible& value) const noexcept; + bool initSourceLayerAndFilter(Layer*, const conversion::Convertible& value) const noexcept; }; /** @@ -117,11 +117,11 @@ public: * * @return LayerManager* */ - static LayerManager* get(); + static LayerManager* get() noexcept; virtual ~LayerManager() = default; /// Returns a new Layer instance on success call; returns `nulltptr` otherwise. - virtual std::unique_ptr createLayer(const std::string& type, const std::string& id, const conversion::Convertible& value, conversion::Error& error) = 0; + virtual std::unique_ptr createLayer(const std::string& type, const std::string& id, const conversion::Convertible& value, conversion::Error& error) noexcept = 0; protected: LayerManager() = default; diff --git a/include/mbgl/style/layers/background_layer.hpp b/include/mbgl/style/layers/background_layer.hpp index 61e95d2273..639cb5154c 100644 --- a/include/mbgl/style/layers/background_layer.hpp +++ b/include/mbgl/style/layers/background_layer.hpp @@ -61,10 +61,10 @@ public: BackgroundLayerFactory(); // LayerFactory overrides. ~BackgroundLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static BackgroundLayerFactory* get(); + static BackgroundLayerFactory* get() noexcept; private: static BackgroundLayerFactory* instance; diff --git a/include/mbgl/style/layers/circle_layer.hpp b/include/mbgl/style/layers/circle_layer.hpp index 92a6bbd92e..4c134a58bf 100644 --- a/include/mbgl/style/layers/circle_layer.hpp +++ b/include/mbgl/style/layers/circle_layer.hpp @@ -109,10 +109,10 @@ public: CircleLayerFactory(); // LayerFactory overrides. ~CircleLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static CircleLayerFactory* get(); + static CircleLayerFactory* get() noexcept; private: static CircleLayerFactory* instance; diff --git a/include/mbgl/style/layers/custom_layer.hpp b/include/mbgl/style/layers/custom_layer.hpp index f58e41adf5..0d13001b91 100644 --- a/include/mbgl/style/layers/custom_layer.hpp +++ b/include/mbgl/style/layers/custom_layer.hpp @@ -90,10 +90,10 @@ public: CustomLayerFactory(); // LayerFactory overrides. ~CustomLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static CustomLayerFactory* get(); + static CustomLayerFactory* get() noexcept; private: static CustomLayerFactory* instance; diff --git a/include/mbgl/style/layers/fill_extrusion_layer.hpp b/include/mbgl/style/layers/fill_extrusion_layer.hpp index bc761f2bec..621eb45bc4 100644 --- a/include/mbgl/style/layers/fill_extrusion_layer.hpp +++ b/include/mbgl/style/layers/fill_extrusion_layer.hpp @@ -85,10 +85,10 @@ public: FillExtrusionLayerFactory(); // LayerFactory overrides. ~FillExtrusionLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static FillExtrusionLayerFactory* get(); + static FillExtrusionLayerFactory* get() noexcept; private: static FillExtrusionLayerFactory* instance; diff --git a/include/mbgl/style/layers/fill_layer.hpp b/include/mbgl/style/layers/fill_layer.hpp index 7ef6727691..aeb0ba988a 100644 --- a/include/mbgl/style/layers/fill_layer.hpp +++ b/include/mbgl/style/layers/fill_layer.hpp @@ -85,10 +85,10 @@ public: FillLayerFactory(); // LayerFactory overrides. ~FillLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static FillLayerFactory* get(); + static FillLayerFactory* get() noexcept; private: static FillLayerFactory* instance; diff --git a/include/mbgl/style/layers/heatmap_layer.hpp b/include/mbgl/style/layers/heatmap_layer.hpp index e38c6ab6e1..3630dafba9 100644 --- a/include/mbgl/style/layers/heatmap_layer.hpp +++ b/include/mbgl/style/layers/heatmap_layer.hpp @@ -74,10 +74,10 @@ public: HeatmapLayerFactory(); // LayerFactory overrides. ~HeatmapLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static HeatmapLayerFactory* get(); + static HeatmapLayerFactory* get() noexcept; private: static HeatmapLayerFactory* instance; diff --git a/include/mbgl/style/layers/hillshade_layer.hpp b/include/mbgl/style/layers/hillshade_layer.hpp index e1e9a4d0a1..a251956d01 100644 --- a/include/mbgl/style/layers/hillshade_layer.hpp +++ b/include/mbgl/style/layers/hillshade_layer.hpp @@ -79,10 +79,10 @@ public: HillshadeLayerFactory(); // LayerFactory overrides. ~HillshadeLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static HillshadeLayerFactory* get(); + static HillshadeLayerFactory* get() noexcept; private: static HillshadeLayerFactory* instance; diff --git a/include/mbgl/style/layers/layer.hpp.ejs b/include/mbgl/style/layers/layer.hpp.ejs index 6006352eee..d335829efb 100644 --- a/include/mbgl/style/layers/layer.hpp.ejs +++ b/include/mbgl/style/layers/layer.hpp.ejs @@ -77,10 +77,10 @@ public: <%- camelize(type) %>LayerFactory(); // LayerFactory overrides. ~<%- camelize(type) %>LayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static <%- camelize(type) %>LayerFactory* get(); + static <%- camelize(type) %>LayerFactory* get() noexcept; private: static <%- camelize(type) %>LayerFactory* instance; diff --git a/include/mbgl/style/layers/line_layer.hpp b/include/mbgl/style/layers/line_layer.hpp index de1ed8eef1..26837f4d06 100644 --- a/include/mbgl/style/layers/line_layer.hpp +++ b/include/mbgl/style/layers/line_layer.hpp @@ -130,10 +130,10 @@ public: LineLayerFactory(); // LayerFactory overrides. ~LineLayerFactory() override; - bool supportsType(const std::string& type) const final; + 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(); + static LineLayerFactory* get() noexcept; private: static LineLayerFactory* instance; diff --git a/include/mbgl/style/layers/raster_layer.hpp b/include/mbgl/style/layers/raster_layer.hpp index 5cf06a7d98..86f57f3d12 100644 --- a/include/mbgl/style/layers/raster_layer.hpp +++ b/include/mbgl/style/layers/raster_layer.hpp @@ -91,10 +91,10 @@ public: RasterLayerFactory(); // LayerFactory overrides. ~RasterLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static RasterLayerFactory* get(); + static RasterLayerFactory* get() noexcept; private: static RasterLayerFactory* instance; diff --git a/include/mbgl/style/layers/symbol_layer.hpp b/include/mbgl/style/layers/symbol_layer.hpp index 5dac5925dd..685e3cb4df 100644 --- a/include/mbgl/style/layers/symbol_layer.hpp +++ b/include/mbgl/style/layers/symbol_layer.hpp @@ -279,10 +279,10 @@ public: SymbolLayerFactory(); // LayerFactory overrides. ~SymbolLayerFactory() override; - bool supportsType(const std::string& type) const final; + bool supportsType(const std::string& type) const noexcept final; std::unique_ptr createLayer(const std::string& id, const conversion::Convertible& value) final; - static SymbolLayerFactory* get(); + static SymbolLayerFactory* get() noexcept; private: static SymbolLayerFactory* instance; diff --git a/platform/android/src/style/layers/layer_manager.cpp b/platform/android/src/style/layers/layer_manager.cpp index ed553bc8e6..72bc317607 100644 --- a/platform/android/src/style/layers/layer_manager.cpp +++ b/platform/android/src/style/layers/layer_manager.cpp @@ -81,7 +81,7 @@ JavaLayerPeerFactory* LayerManagerAndroid::getPeerFactory(mbgl::style::Layer* la return nullptr; } -std::unique_ptr LayerManagerAndroid::createLayer(const std::string& type, const std::string& id, const style::conversion::Convertible& value, style::conversion::Error& error) { +std::unique_ptr LayerManagerAndroid::createLayer(const std::string& type, const std::string& id, const style::conversion::Convertible& value, style::conversion::Error& error) noexcept{ for (const auto& factory: factories) { auto* layerFactory = factory->getLayerFactory(); if (layerFactory->supportsType(type)) { @@ -97,7 +97,7 @@ std::unique_ptr LayerManagerAndroid::createLayer(const std::string } // static -LayerManagerAndroid* LayerManagerAndroid::get() { +LayerManagerAndroid* LayerManagerAndroid::get() noexcept { static LayerManagerAndroid impl; return &impl; } @@ -106,7 +106,7 @@ LayerManagerAndroid* LayerManagerAndroid::get() { namespace style { // static -LayerManager* LayerManager::get() { +LayerManager* LayerManager::get() noexcept { return android::LayerManagerAndroid::get(); } diff --git a/platform/android/src/style/layers/layer_manager.hpp b/platform/android/src/style/layers/layer_manager.hpp index 7684108555..cec9d39d8c 100644 --- a/platform/android/src/style/layers/layer_manager.hpp +++ b/platform/android/src/style/layers/layer_manager.hpp @@ -19,7 +19,7 @@ namespace android { class LayerManagerAndroid : public mbgl::style::LayerManager { public: ~LayerManagerAndroid() override; - static LayerManagerAndroid* get(); + static LayerManagerAndroid* get() noexcept; jni::Local> createJavaLayerPeer(jni::JNIEnv&, mbgl::Map&, mbgl::style::Layer&); jni::Local> createJavaLayerPeer(jni::JNIEnv& env, mbgl::Map& map, std::unique_ptr); @@ -30,7 +30,7 @@ private: LayerManagerAndroid(); JavaLayerPeerFactory* getPeerFactory(mbgl::style::Layer*); // mbgl:style::LayerManager overrides. - std::unique_ptr createLayer(const std::string& type, const std::string& id, const style::conversion::Convertible& value, style::conversion::Error& error) final; + std::unique_ptr createLayer(const std::string& type, const std::string& id, const style::conversion::Convertible& value, style::conversion::Error& error) noexcept final; std::vector> factories; }; diff --git a/platform/default/layer_manager.cpp b/platform/default/layer_manager.cpp index e497c66729..919bc9e64e 100644 --- a/platform/default/layer_manager.cpp +++ b/platform/default/layer_manager.cpp @@ -21,7 +21,7 @@ public: LayerManagerBase(); private: // LayerManager overrides. - std::unique_ptr createLayer(const std::string& type, const std::string& id, const conversion::Convertible& value, conversion::Error& error) final; + std::unique_ptr createLayer(const std::string& type, const std::string& id, const conversion::Convertible& value, conversion::Error& error) noexcept final; std::vector> factories; }; @@ -37,7 +37,10 @@ LayerManagerBase::LayerManagerBase() { factories.emplace_back(std::unique_ptr(new HeatmapLayerFactory)); } -std::unique_ptr LayerManagerBase::createLayer(const std::string& type, const std::string& id, const conversion::Convertible& value, conversion::Error& error) { +std::unique_ptr LayerManagerBase::createLayer(const std::string& type, + const std::string& id, + const conversion::Convertible& value, + conversion::Error& error) noexcept { for (const auto& factory: factories) { if (factory->supportsType(type)) { auto layer = factory->createLayer(id, value); @@ -52,7 +55,7 @@ std::unique_ptr LayerManagerBase::createLayer(const std::string& type, co } // static -LayerManager* LayerManager::get() { +LayerManager* LayerManager::get() noexcept { static LayerManagerBase impl; return &impl; } diff --git a/src/mbgl/style/layer.cpp b/src/mbgl/style/layer.cpp index e26a02686e..2225fa921b 100644 --- a/src/mbgl/style/layer.cpp +++ b/src/mbgl/style/layer.cpp @@ -107,7 +107,7 @@ optional Layer::setVisibility(const conversion::Convertible& return nullopt; } -optional LayerFactory::getSource(const conversion::Convertible& value) const { +optional LayerFactory::getSource(const conversion::Convertible& value) const noexcept { auto sourceValue = objectMember(value, "source"); if (!sourceValue) { return nullopt; @@ -121,7 +121,7 @@ optional LayerFactory::getSource(const conversion::Convertible& val return source; } -bool LayerFactory::initSourceLayerAndFilter(Layer* layer, const conversion::Convertible& value) const { +bool LayerFactory::initSourceLayerAndFilter(Layer* layer, const conversion::Convertible& value) const noexcept { auto sourceLayerValue = objectMember(value, "source-layer"); if (sourceLayerValue) { optional sourceLayer = toString(*sourceLayerValue); diff --git a/src/mbgl/style/layer_impl.hpp b/src/mbgl/style/layer_impl.hpp index f30db14cc9..74d1f2b211 100644 --- a/src/mbgl/style/layer_impl.hpp +++ b/src/mbgl/style/layer_impl.hpp @@ -41,7 +41,7 @@ public: // Utility function for automatic layer grouping. virtual void stringifyLayout(rapidjson::Writer&) const = 0; - virtual LayerFactory* getLayerFactory() const = 0; + virtual LayerFactory* getLayerFactory() const noexcept = 0; const LayerType type; std::string id; diff --git a/src/mbgl/style/layers/background_layer.cpp b/src/mbgl/style/layers/background_layer.cpp index 8b3ce5ff68..d84c7b66de 100644 --- a/src/mbgl/style/layers/background_layer.cpp +++ b/src/mbgl/style/layers/background_layer.cpp @@ -42,7 +42,7 @@ std::unique_ptr BackgroundLayer::cloneRef(const std::string& id_) const { void BackgroundLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } -LayerFactory* BackgroundLayer::Impl::getLayerFactory() const { +LayerFactory* BackgroundLayer::Impl::getLayerFactory() const noexcept { return BackgroundLayerFactory::get(); } @@ -284,12 +284,12 @@ BackgroundLayerFactory::BackgroundLayerFactory() { BackgroundLayerFactory::~BackgroundLayerFactory() = default; // static -BackgroundLayerFactory* BackgroundLayerFactory::get() { +BackgroundLayerFactory* BackgroundLayerFactory::get() noexcept { assert(instance); return instance; } -bool BackgroundLayerFactory::supportsType(const std::string& type) const { +bool BackgroundLayerFactory::supportsType(const std::string& type) const noexcept { return type == "background"; } diff --git a/src/mbgl/style/layers/background_layer_impl.hpp b/src/mbgl/style/layers/background_layer_impl.hpp index d48f0f62c8..da81233824 100644 --- a/src/mbgl/style/layers/background_layer_impl.hpp +++ b/src/mbgl/style/layers/background_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; BackgroundPaintProperties::Transitionable paint; }; diff --git a/src/mbgl/style/layers/circle_layer.cpp b/src/mbgl/style/layers/circle_layer.cpp index 01a71df6d3..c1f084f03a 100644 --- a/src/mbgl/style/layers/circle_layer.cpp +++ b/src/mbgl/style/layers/circle_layer.cpp @@ -42,7 +42,7 @@ std::unique_ptr CircleLayer::cloneRef(const std::string& id_) const { void CircleLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } -LayerFactory* CircleLayer::Impl::getLayerFactory() const { +LayerFactory* CircleLayer::Impl::getLayerFactory() const noexcept { return CircleLayerFactory::get(); } @@ -701,12 +701,12 @@ CircleLayerFactory::CircleLayerFactory() { CircleLayerFactory::~CircleLayerFactory() = default; // static -CircleLayerFactory* CircleLayerFactory::get() { +CircleLayerFactory* CircleLayerFactory::get() noexcept { assert(instance); return instance; } -bool CircleLayerFactory::supportsType(const std::string& type) const { +bool CircleLayerFactory::supportsType(const std::string& type) const noexcept { return type == "circle"; } diff --git a/src/mbgl/style/layers/circle_layer_impl.hpp b/src/mbgl/style/layers/circle_layer_impl.hpp index 8390feb97e..a6eca13c79 100644 --- a/src/mbgl/style/layers/circle_layer_impl.hpp +++ b/src/mbgl/style/layers/circle_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; CirclePaintProperties::Transitionable paint; }; diff --git a/src/mbgl/style/layers/custom_layer.cpp b/src/mbgl/style/layers/custom_layer.cpp index 060e455217..012771ec94 100644 --- a/src/mbgl/style/layers/custom_layer.cpp +++ b/src/mbgl/style/layers/custom_layer.cpp @@ -49,12 +49,12 @@ CustomLayerFactory::CustomLayerFactory() { CustomLayerFactory::~CustomLayerFactory() = default; // static -CustomLayerFactory* CustomLayerFactory::get() { +CustomLayerFactory* CustomLayerFactory::get() noexcept { assert(instance); return instance; } -bool CustomLayerFactory::supportsType(const std::string&) const { +bool CustomLayerFactory::supportsType(const std::string&) const noexcept { return false; } diff --git a/src/mbgl/style/layers/custom_layer_impl.cpp b/src/mbgl/style/layers/custom_layer_impl.cpp index ce8d5263dd..81d0fd344a 100644 --- a/src/mbgl/style/layers/custom_layer_impl.cpp +++ b/src/mbgl/style/layers/custom_layer_impl.cpp @@ -16,7 +16,7 @@ bool CustomLayer::Impl::hasLayoutDifference(const Layer::Impl&) const { void CustomLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } -LayerFactory* CustomLayer::Impl::getLayerFactory() const { +LayerFactory* CustomLayer::Impl::getLayerFactory() const noexcept { return CustomLayerFactory::get(); } diff --git a/src/mbgl/style/layers/custom_layer_impl.hpp b/src/mbgl/style/layers/custom_layer_impl.hpp index ad39478df9..c9faba11c6 100644 --- a/src/mbgl/style/layers/custom_layer_impl.hpp +++ b/src/mbgl/style/layers/custom_layer_impl.hpp @@ -18,7 +18,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; std::shared_ptr host; }; diff --git a/src/mbgl/style/layers/fill_extrusion_layer.cpp b/src/mbgl/style/layers/fill_extrusion_layer.cpp index 3eccf045ea..c230e7f7f9 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer.cpp +++ b/src/mbgl/style/layers/fill_extrusion_layer.cpp @@ -42,7 +42,7 @@ std::unique_ptr FillExtrusionLayer::cloneRef(const std::string& id_) cons void FillExtrusionLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } -LayerFactory* FillExtrusionLayer::Impl::getLayerFactory() const { +LayerFactory* FillExtrusionLayer::Impl::getLayerFactory() const noexcept { return FillExtrusionLayerFactory::get(); } @@ -503,12 +503,12 @@ FillExtrusionLayerFactory::FillExtrusionLayerFactory() { FillExtrusionLayerFactory::~FillExtrusionLayerFactory() = default; // static -FillExtrusionLayerFactory* FillExtrusionLayerFactory::get() { +FillExtrusionLayerFactory* FillExtrusionLayerFactory::get() noexcept { assert(instance); return instance; } -bool FillExtrusionLayerFactory::supportsType(const std::string& type) const { +bool FillExtrusionLayerFactory::supportsType(const std::string& type) const noexcept { return type == "fill-extrusion"; } diff --git a/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp b/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp index dfbc3939f0..9dad845edc 100644 --- a/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp +++ b/src/mbgl/style/layers/fill_extrusion_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; Properties<>::Unevaluated layout; FillExtrusionPaintProperties::Transitionable paint; diff --git a/src/mbgl/style/layers/fill_layer.cpp b/src/mbgl/style/layers/fill_layer.cpp index 53eb328326..2b81fd6fa4 100644 --- a/src/mbgl/style/layers/fill_layer.cpp +++ b/src/mbgl/style/layers/fill_layer.cpp @@ -42,7 +42,7 @@ std::unique_ptr FillLayer::cloneRef(const std::string& id_) const { void FillLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } -LayerFactory* FillLayer::Impl::getLayerFactory() const { +LayerFactory* FillLayer::Impl::getLayerFactory() const noexcept { return FillLayerFactory::get(); } @@ -503,12 +503,12 @@ FillLayerFactory::FillLayerFactory() { FillLayerFactory::~FillLayerFactory() = default; // static -FillLayerFactory* FillLayerFactory::get() { +FillLayerFactory* FillLayerFactory::get() noexcept { assert(instance); return instance; } -bool FillLayerFactory::supportsType(const std::string& type) const { +bool FillLayerFactory::supportsType(const std::string& type) const noexcept { return type == "fill"; } diff --git a/src/mbgl/style/layers/fill_layer_impl.hpp b/src/mbgl/style/layers/fill_layer_impl.hpp index b99f4303d9..ae7a1a5a3e 100644 --- a/src/mbgl/style/layers/fill_layer_impl.hpp +++ b/src/mbgl/style/layers/fill_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; Properties<>::Unevaluated layout; FillPaintProperties::Transitionable paint; diff --git a/src/mbgl/style/layers/heatmap_layer.cpp b/src/mbgl/style/layers/heatmap_layer.cpp index 5afd951d58..eb6033d727 100644 --- a/src/mbgl/style/layers/heatmap_layer.cpp +++ b/src/mbgl/style/layers/heatmap_layer.cpp @@ -42,7 +42,7 @@ std::unique_ptr HeatmapLayer::cloneRef(const std::string& id_) const { void HeatmapLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } -LayerFactory* HeatmapLayer::Impl::getLayerFactory() const { +LayerFactory* HeatmapLayer::Impl::getLayerFactory() const noexcept { return HeatmapLayerFactory::get(); } @@ -388,12 +388,12 @@ HeatmapLayerFactory::HeatmapLayerFactory() { HeatmapLayerFactory::~HeatmapLayerFactory() = default; // static -HeatmapLayerFactory* HeatmapLayerFactory::get() { +HeatmapLayerFactory* HeatmapLayerFactory::get() noexcept { assert(instance); return instance; } -bool HeatmapLayerFactory::supportsType(const std::string& type) const { +bool HeatmapLayerFactory::supportsType(const std::string& type) const noexcept { return type == "heatmap"; } diff --git a/src/mbgl/style/layers/heatmap_layer_impl.hpp b/src/mbgl/style/layers/heatmap_layer_impl.hpp index 55de21341b..10c0e4aa46 100644 --- a/src/mbgl/style/layers/heatmap_layer_impl.hpp +++ b/src/mbgl/style/layers/heatmap_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; HeatmapPaintProperties::Transitionable paint; }; diff --git a/src/mbgl/style/layers/hillshade_layer.cpp b/src/mbgl/style/layers/hillshade_layer.cpp index 2bc0120ac1..27c7c7b6d7 100644 --- a/src/mbgl/style/layers/hillshade_layer.cpp +++ b/src/mbgl/style/layers/hillshade_layer.cpp @@ -42,7 +42,7 @@ std::unique_ptr HillshadeLayer::cloneRef(const std::string& id_) const { void HillshadeLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } -LayerFactory* HillshadeLayer::Impl::getLayerFactory() const { +LayerFactory* HillshadeLayer::Impl::getLayerFactory() const noexcept { return HillshadeLayerFactory::get(); } @@ -435,12 +435,12 @@ HillshadeLayerFactory::HillshadeLayerFactory() { HillshadeLayerFactory::~HillshadeLayerFactory() = default; // static -HillshadeLayerFactory* HillshadeLayerFactory::get() { +HillshadeLayerFactory* HillshadeLayerFactory::get() noexcept { assert(instance); return instance; } -bool HillshadeLayerFactory::supportsType(const std::string& type) const { +bool HillshadeLayerFactory::supportsType(const std::string& type) const noexcept { return type == "hillshade"; } diff --git a/src/mbgl/style/layers/hillshade_layer_impl.hpp b/src/mbgl/style/layers/hillshade_layer_impl.hpp index ad94ac9790..84b4aebf85 100644 --- a/src/mbgl/style/layers/hillshade_layer_impl.hpp +++ b/src/mbgl/style/layers/hillshade_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; HillshadePaintProperties::Transitionable paint; }; diff --git a/src/mbgl/style/layers/layer.cpp.ejs b/src/mbgl/style/layers/layer.cpp.ejs index 85173c2eac..716f4ab854 100644 --- a/src/mbgl/style/layers/layer.cpp.ejs +++ b/src/mbgl/style/layers/layer.cpp.ejs @@ -59,7 +59,7 @@ void <%- camelize(type) %>Layer::Impl::stringifyLayout(rapidjson::Writer -LayerFactory* <%- camelize(type) %>Layer::Impl::getLayerFactory() const { +LayerFactory* <%- camelize(type) %>Layer::Impl::getLayerFactory() const noexcept { return <%- camelize(type) %>LayerFactory::get(); } @@ -274,12 +274,12 @@ Mutable <%- camelize(type) %>Layer::mutableBaseImpl() const { <%- camelize(type) %>LayerFactory::~<%- camelize(type) %>LayerFactory() = default; // static -<%- camelize(type) %>LayerFactory* <%- camelize(type) %>LayerFactory::get() { +<%- camelize(type) %>LayerFactory* <%- camelize(type) %>LayerFactory::get() noexcept { assert(instance); return instance; } -bool <%- camelize(type) %>LayerFactory::supportsType(const std::string& type) const { +bool <%- camelize(type) %>LayerFactory::supportsType(const std::string& type) const noexcept { return type == "<%- type %>"; } diff --git a/src/mbgl/style/layers/line_layer.cpp b/src/mbgl/style/layers/line_layer.cpp index 2175ab54a1..9d0504e0b1 100644 --- a/src/mbgl/style/layers/line_layer.cpp +++ b/src/mbgl/style/layers/line_layer.cpp @@ -43,7 +43,7 @@ void LineLayer::Impl::stringifyLayout(rapidjson::Writer layout.stringify(writer); } -LayerFactory* LineLayer::Impl::getLayerFactory() const { +LayerFactory* LineLayer::Impl::getLayerFactory() const noexcept { return LineLayerFactory::get(); } @@ -842,12 +842,12 @@ LineLayerFactory::LineLayerFactory() { LineLayerFactory::~LineLayerFactory() = default; // static -LineLayerFactory* LineLayerFactory::get() { +LineLayerFactory* LineLayerFactory::get() noexcept { assert(instance); return instance; } -bool LineLayerFactory::supportsType(const std::string& type) const { +bool LineLayerFactory::supportsType(const std::string& type) const noexcept { return type == "line"; } diff --git a/src/mbgl/style/layers/line_layer_impl.hpp b/src/mbgl/style/layers/line_layer_impl.hpp index 9faa192c5f..0283c38885 100644 --- a/src/mbgl/style/layers/line_layer_impl.hpp +++ b/src/mbgl/style/layers/line_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; LineLayoutProperties::Unevaluated layout; LinePaintProperties::Transitionable paint; diff --git a/src/mbgl/style/layers/raster_layer.cpp b/src/mbgl/style/layers/raster_layer.cpp index f45b86f796..d9ac1add42 100644 --- a/src/mbgl/style/layers/raster_layer.cpp +++ b/src/mbgl/style/layers/raster_layer.cpp @@ -42,7 +42,7 @@ std::unique_ptr RasterLayer::cloneRef(const std::string& id_) const { void RasterLayer::Impl::stringifyLayout(rapidjson::Writer&) const { } -LayerFactory* RasterLayer::Impl::getLayerFactory() const { +LayerFactory* RasterLayer::Impl::getLayerFactory() const noexcept { return RasterLayerFactory::get(); } @@ -524,12 +524,12 @@ RasterLayerFactory::RasterLayerFactory() { RasterLayerFactory::~RasterLayerFactory() = default; // static -RasterLayerFactory* RasterLayerFactory::get() { +RasterLayerFactory* RasterLayerFactory::get() noexcept { assert(instance); return instance; } -bool RasterLayerFactory::supportsType(const std::string& type) const { +bool RasterLayerFactory::supportsType(const std::string& type) const noexcept { return type == "raster"; } diff --git a/src/mbgl/style/layers/raster_layer_impl.hpp b/src/mbgl/style/layers/raster_layer_impl.hpp index 9916a01d47..450daf11bf 100644 --- a/src/mbgl/style/layers/raster_layer_impl.hpp +++ b/src/mbgl/style/layers/raster_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; RasterPaintProperties::Transitionable paint; }; diff --git a/src/mbgl/style/layers/symbol_layer.cpp b/src/mbgl/style/layers/symbol_layer.cpp index 682c7fbdf6..5380194534 100644 --- a/src/mbgl/style/layers/symbol_layer.cpp +++ b/src/mbgl/style/layers/symbol_layer.cpp @@ -43,7 +43,7 @@ void SymbolLayer::Impl::stringifyLayout(rapidjson::Writer&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; SymbolLayoutProperties::Unevaluated layout; SymbolPaintProperties::Transitionable paint; -- cgit v1.2.1