summaryrefslogtreecommitdiff
path: root/include/mbgl/style/function/composite_interval_stops.hpp
blob: 3c495f2a7f40223db1a97f7ac66f3829eafaee01 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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