summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorIvo van Dongen <info@ivovandongen.nl>2016-08-17 19:02:48 +0200
committerIvo van Dongen <info@ivovandongen.nl>2016-08-18 11:48:41 +0200
commit26bdcadf7e20c94086a87991cfad80a14cb7a63b (patch)
treeba4faf2992c302eb8353f38b2255d60f01384337 /include
parent9fe22bc0cd9cb7bdab74df4e2f275fc27a421530 (diff)
downloadqtlocation-mapboxgl-26bdcadf7e20c94086a87991cfad80a14cb7a63b.tar.gz
[core] added template instances for Source.is<>().
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/sources/geojson_source.hpp5
-rw-r--r--include/mbgl/style/sources/raster_source.hpp5
-rw-r--r--include/mbgl/style/sources/vector_source.hpp5
3 files changed, 15 insertions, 0 deletions
diff --git a/include/mbgl/style/sources/geojson_source.hpp b/include/mbgl/style/sources/geojson_source.hpp
index 37ddce1bcc..306a330252 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<GeoJSONSource>() 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 2d1d648eec..9bb951992c 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<RasterSource>() 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 3d53362734..e16a6a68af 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<VectorSource>() const {
+ return type == SourceType::Vector;
+}
+
} // namespace style
} // namespace mbgl