summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJohn Firebaugh <john.firebaugh@gmail.com>2018-01-08 13:18:40 -0800
committerJohn Firebaugh <john.firebaugh@gmail.com>2018-01-09 16:10:51 -0800
commita13027c1b6e2aa9a213628acf9124cd6c872f204 (patch)
treec0c86f052025c3637c9af0922551492f4398860b /include
parent43a9bd3fbab666f21583ff264d6b6ba1d7069374 (diff)
downloadqtlocation-mapboxgl-a13027c1b6e2aa9a213628acf9124cd6c872f204.tar.gz
[core] Improve typing for !=, == expressions
Diffstat (limited to 'include')
-rw-r--r--include/mbgl/style/expression/equals.hpp31
1 files changed, 31 insertions, 0 deletions
diff --git a/include/mbgl/style/expression/equals.hpp b/include/mbgl/style/expression/equals.hpp
new file mode 100644
index 0000000000..3c0c024294
--- /dev/null
+++ b/include/mbgl/style/expression/equals.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <mbgl/style/expression/expression.hpp>
+#include <mbgl/style/expression/parsing_context.hpp>
+#include <mbgl/style/conversion.hpp>
+
+#include <memory>
+
+namespace mbgl {
+namespace style {
+namespace expression {
+
+class Equals : public Expression {
+public:
+ Equals(std::unique_ptr<Expression> lhs, std::unique_ptr<Expression> rhs, bool negate);
+
+ static ParseResult parse(const mbgl::style::conversion::Convertible&, ParsingContext&);
+
+ void eachChild(const std::function<void(const Expression&)>& visit) const override;
+ bool operator==(const Expression&) const override;
+ EvaluationResult evaluate(const EvaluationContext&) const override;
+
+private:
+ std::unique_ptr<Expression> lhs;
+ std::unique_ptr<Expression> rhs;
+ bool negate;
+};
+
+} // namespace expression
+} // namespace style
+} // namespace mbgl