diff options
author | John Firebaugh <john.firebaugh@gmail.com> | 2018-06-28 07:47:28 -0700 |
---|---|---|
committer | John Firebaugh <john.firebaugh@gmail.com> | 2018-06-28 10:00:40 -0700 |
commit | b2f6acca6161e1547bd99e0fca1ce51ea7e632e9 (patch) | |
tree | d37a999213666ba57126a7d6dcbd2c68dad314c4 /include/mbgl | |
parent | bc771ee02e813e0f05663f108d34d3fd057dbd66 (diff) | |
download | qtlocation-mapboxgl-b2f6acca6161e1547bd99e0fca1ce51ea7e632e9.tar.gz |
[core] Move non-polymorphic Interpolate methods to base
Diffstat (limited to 'include/mbgl')
-rw-r--r-- | include/mbgl/style/expression/interpolate.hpp | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/include/mbgl/style/expression/interpolate.hpp b/include/mbgl/style/expression/interpolate.hpp index 1f73fc14b4..1a98189e29 100644 --- a/include/mbgl/style/expression/interpolate.hpp +++ b/include/mbgl/style/expression/interpolate.hpp @@ -55,7 +55,23 @@ public: ); } + bool operator==(const Expression& e) const override { + if (auto rhs = dynamic_cast<const InterpolateBase*>(&e)) { + if (interpolator != rhs->interpolator || + *input != *(rhs->input) || + stops.size() != rhs->stops.size()) + { + return false; + } + + return Expression::childrenEqual(stops, rhs->stops); + } + return false; + } + std::vector<optional<Value>> possibleOutputs() const override; + mbgl::Value serialize() const override; + std::string getOperator() const override { return "interpolate"; } protected: const Interpolator interpolator; @@ -130,23 +146,6 @@ public: return util::interpolate(lower->get<T>(), upper->get<T>(), t); } } - - bool operator==(const Expression& e) const override { - if (auto rhs = dynamic_cast<const Interpolate*>(&e)) { - if (interpolator != rhs->interpolator || - *input != *(rhs->input) || - stops.size() != rhs->stops.size()) - { - return false; - } - - return Expression::childrenEqual(stops, rhs->stops); - } - return false; - } - - mbgl::Value serialize() const override; - std::string getOperator() const override { return "interpolate"; } }; } // namespace expression |