From 26bdcadf7e20c94086a87991cfad80a14cb7a63b Mon Sep 17 00:00:00 2001 From: Ivo van Dongen Date: Wed, 17 Aug 2016 19:02:48 +0200 Subject: [PATCH] [core] added template instances for Source.is<>(). --- include/mbgl/style/sources/geojson_source.hpp | 5 +++++ include/mbgl/style/sources/raster_source.hpp | 5 +++++ include/mbgl/style/sources/vector_source.hpp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp index 37ddce1bc..306a33025 100644 --- a/include/mbgl/style/sources/geojson_source.hpp +++ b/include/mbgl/style/sources/geojson_source.hpp @@ -50,5 +50,10 @@ public: Impl* const impl; }; +template <> +inline bool Source::is() const { + return type == SourceType::GeoJSON; +} + } // namespace style } // namespace mbgl diff --git a/include/mbgl/style/sources/raster_source.hpp b/include/mbgl/style/sources/raster_source.hpp index 2d1d648ee..9bb951992 100644 --- a/include/mbgl/style/sources/raster_source.hpp +++ b/include/mbgl/style/sources/raster_source.hpp @@ -16,5 +16,10 @@ public: class Impl; }; +template <> +inline bool Source::is() const { + return type == SourceType::Raster; +} + } // namespace style } // namespace mbgl diff --git a/include/mbgl/style/sources/vector_source.hpp b/include/mbgl/style/sources/vector_source.hpp index 3d5336273..e16a6a68a 100644 --- a/include/mbgl/style/sources/vector_source.hpp +++ b/include/mbgl/style/sources/vector_source.hpp @@ -16,5 +16,10 @@ public: class Impl; }; +template <> +inline bool Source::is() const { + return type == SourceType::Vector; +} + } // namespace style } // namespace mbgl