summaryrefslogtreecommitdiff
path: root/src/mbgl/style/paint_property_statistics.hpp
blob: 01d634dd6f11891cbb5519ba3d9ba5d29dab998e (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
#pragma once

#include <mbgl/util/optional.hpp>

namespace mbgl {
namespace style {

template <class T>
class PaintPropertyStatistics {
public:
    optional<T> max() const { return {}; }
    void add(const T&) {}
};

template <>
class PaintPropertyStatistics<float> {
public:
    optional<float> max() const {
        return _max;
    }

    void add(float value) {
        _max = _max ? std::max(*_max, value) : value;
    }

private:
    optional<float> _max;
};

} // namespace style
} // namespace mbgl