diff options
Diffstat (limited to 'src/mbgl/style/paint_property_statistics.hpp')
-rw-r--r-- | src/mbgl/style/paint_property_statistics.hpp | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/mbgl/style/paint_property_statistics.hpp b/src/mbgl/style/paint_property_statistics.hpp new file mode 100644 index 0000000000..01d634dd6f --- /dev/null +++ b/src/mbgl/style/paint_property_statistics.hpp @@ -0,0 +1,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 |