#pragma once #include #include #include namespace mbgl { namespace style { template class Function { public: using Stop = std::pair; using Stops = std::vector; Function(Stops stops_, float base_) : base(base_), stops(std::move(stops_)) { assert(stops.size() > 0); } float getBase() const { return base; } const std::vector>& getStops() const { return stops; } T evaluate(float z) const; friend bool operator==(const Function& lhs, const Function& rhs) { return lhs.base == rhs.base && lhs.stops == rhs.stops; } friend bool operator!=(const Function& lhs, const Function& rhs) { return !(lhs == rhs); } private: float base = 1; std::vector> stops; }; } // namespace style } // namespace mbgl