diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-07 12:35:27 -0800 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2017-02-09 11:16:26 -0600 |
commit | f35ca0d9dfc8a6ba88273edbeda43e633ae0adce (patch) | |
tree | 74c11b9c7125c22516a5cbc46322763a72964c43 /include/mbgl/style/function/composite_interval_stops.hpp | |
parent | 9df24addfbfd922baada7d9778f402b91e69ed33 (diff) | |
download | qtlocation-mapboxgl-f35ca0d9dfc8a6ba88273edbeda43e633ae0adce.tar.gz |
[core, ios, macos] Refactor composite stop types and conversions
Diffstat (limited to 'include/mbgl/style/function/composite_interval_stops.hpp')
-rw-r--r-- | include/mbgl/style/function/composite_interval_stops.hpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/include/mbgl/style/function/composite_interval_stops.hpp b/include/mbgl/style/function/composite_interval_stops.hpp new file mode 100644 index 0000000000..3c495f2a7f --- /dev/null +++ b/include/mbgl/style/function/composite_interval_stops.hpp @@ -0,0 +1,32 @@ +#pragma once + +#include <mbgl/style/function/interval_stops.hpp> + +#include <map> + +namespace mbgl { +namespace style { + +template <class T> +class CompositeIntervalStops { +public: + using Stops = std::map<float, std::map<float, T>>; + Stops stops; + + CompositeIntervalStops() = default; + CompositeIntervalStops(Stops stops_) + : stops(std::move(stops_)) { + } + + IntervalStops<T> innerStops(const std::map<float, T>& stops_) const { + return IntervalStops<T>(stops_); + } + + friend bool operator==(const CompositeIntervalStops& lhs, + const CompositeIntervalStops& rhs) { + return lhs.stops == rhs.stops; + } +}; + +} // namespace style +} // namespace mbgl |