diff options
author | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-11-06 16:48:18 +0200 |
---|---|---|
committer | Mikhail Pozdnyakov <mikhail.pozdnyakov@mapbox.com> | 2018-11-07 16:34:20 +0200 |
commit | 5a70f2b15081bede66a2d736dc3e8f90ba73d601 (patch) | |
tree | ea4ac754f100303760c0120e25474eaba0ab7b66 /src | |
parent | 1ba1ead3eab5eb27c24163b93b04b49ffbdf2a3b (diff) | |
download | qtlocation-mapboxgl-5a70f2b15081bede66a2d736dc3e8f90ba73d601.tar.gz |
noexcept specifier for layer factory methods
Diffstat (limited to 'src')
24 files changed, 46 insertions, 46 deletions
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<conversion::Error> Layer::setVisibility(const conversion::Convertible& return nullopt; } -optional<std::string> LayerFactory::getSource(const conversion::Convertible& value) const { +optional<std::string> LayerFactory::getSource(const conversion::Convertible& value) const noexcept { auto sourceValue = objectMember(value, "source"); if (!sourceValue) { return nullopt; @@ -121,7 +121,7 @@ optional<std::string> 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<std::string> 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<rapidjson::StringBuffer>&) 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<Layer> BackgroundLayer::cloneRef(const std::string& id_) const { void BackgroundLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) 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<Layer> CircleLayer::cloneRef(const std::string& id_) const { void CircleLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; std::shared_ptr<CustomLayerHost> 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<Layer> FillExtrusionLayer::cloneRef(const std::string& id_) cons void FillExtrusionLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) 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<Layer> FillLayer::cloneRef(const std::string& id_) const { void FillLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) 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<Layer> HeatmapLayer::cloneRef(const std::string& id_) const { void HeatmapLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) 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<Layer> HillshadeLayer::cloneRef(const std::string& id_) const { void HillshadeLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) 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<rapidjs } <% } -%> -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<Layer::Impl> <%- 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<rapidjson::StringBuffer> 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<rapidjson::StringBuffer>&) 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<Layer> RasterLayer::cloneRef(const std::string& id_) const { void RasterLayer::Impl::stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffer>&) 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<rapidjson::StringBuffe layout.stringify(writer); } -LayerFactory* SymbolLayer::Impl::getLayerFactory() const { +LayerFactory* SymbolLayer::Impl::getLayerFactory() const noexcept { return SymbolLayerFactory::get(); } @@ -1992,12 +1992,12 @@ SymbolLayerFactory::SymbolLayerFactory() { SymbolLayerFactory::~SymbolLayerFactory() = default; // static -SymbolLayerFactory* SymbolLayerFactory::get() { +SymbolLayerFactory* SymbolLayerFactory::get() noexcept { assert(instance); return instance; } -bool SymbolLayerFactory::supportsType(const std::string& type) const { +bool SymbolLayerFactory::supportsType(const std::string& type) const noexcept { return type == "symbol"; } diff --git a/src/mbgl/style/layers/symbol_layer_impl.hpp b/src/mbgl/style/layers/symbol_layer_impl.hpp index 2b88bad315..b735e7ce8d 100644 --- a/src/mbgl/style/layers/symbol_layer_impl.hpp +++ b/src/mbgl/style/layers/symbol_layer_impl.hpp @@ -13,7 +13,7 @@ public: bool hasLayoutDifference(const Layer::Impl&) const override; void stringifyLayout(rapidjson::Writer<rapidjson::StringBuffer>&) const override; - LayerFactory* getLayerFactory() const final; + LayerFactory* getLayerFactory() const noexcept final; SymbolLayoutProperties::Unevaluated layout; SymbolPaintProperties::Transitionable paint; |