summaryrefslogtreecommitdiff
path: root/include/mbgl/style/expression/equals.hpp
blob: 80550bd59dd45e2d57599d0ddc8ce06ef3dbb2aa (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
32
#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;
    std::vector<optional<Value>> possibleOutputs() const override;

private:
    std::unique_ptr<Expression> lhs;
    std::unique_ptr<Expression> rhs;
    bool negate;
};

} // namespace expression
} // namespace style
} // namespace mbgl