MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
boolean_operator.hpp
Go to the documentation of this file.
1 #pragma once
2 
5 
6 #include <memory>
7 
8 namespace mbgl {
9 namespace style {
10 namespace expression {
11 
12 class Any : public Expression {
13 public:
14  Any(std::vector<std::unique_ptr<Expression>> inputs_) :
15  Expression(Kind::Any, type::Boolean),
16  inputs(std::move(inputs_))
17  {}
18 
20 
21  EvaluationResult evaluate(const EvaluationContext& params) const override;
22  void eachChild(const std::function<void(const Expression&)>& visit) const override;
23  bool operator==(const Expression& e) const override;
24  std::vector<std::optional<Value>> possibleOutputs() const override;
25 
26  std::string getOperator() const override { return "any"; }
27 private:
28  std::vector<std::unique_ptr<Expression>> inputs;
29 };
30 
31 class All : public Expression {
32 public:
33  All(std::vector<std::unique_ptr<Expression>> inputs_) :
34  Expression(Kind::All, type::Boolean),
35  inputs(std::move(inputs_))
36  {}
37 
39 
40  EvaluationResult evaluate(const EvaluationContext& params) const override;
41  void eachChild(const std::function<void(const Expression&)>& visit) const override;
42  bool operator==(const Expression& e) const override;
43  std::vector<std::optional<Value>> possibleOutputs() const override;
44 
45  std::string getOperator() const override { return "all"; }
46 private:
47  std::vector<std::unique_ptr<Expression>> inputs;
48 };
49 
50 } // namespace expression
51 } // namespace style
52 } // namespace mbgl
void eachChild(const std::function< void(const Expression &)> &visit) const override
EvaluationResult evaluate(const EvaluationContext &params) const override
std::string getOperator() const override
bool operator==(const Expression &e) const override
All(std::vector< std::unique_ptr< Expression >> inputs_)
static ParseResult parse(const mbgl::style::conversion::Convertible &value, ParsingContext &ctx)
std::vector< std::optional< Value > > possibleOutputs() const override
bool operator==(const Expression &e) const override
static ParseResult parse(const mbgl::style::conversion::Convertible &value, ParsingContext &ctx)
Any(std::vector< std::unique_ptr< Expression >> inputs_)
std::string getOperator() const override
std::vector< std::optional< Value > > possibleOutputs() const override
EvaluationResult evaluate(const EvaluationContext &params) const override
void eachChild(const std::function< void(const Expression &)> &visit) const override
std::unique_ptr< Expression > string(std::unique_ptr< Expression >, std::unique_ptr< Expression > def=nullptr)
constexpr BooleanType Boolean
Definition: type.hpp:86
std::optional< std::unique_ptr< Expression > > ParseResult
Definition: actor.hpp:15
Definition: tile_id.hpp:256