Files
MapLibreParticleLab/include/mbgl/style/expression/boolean_operator.hpp
Tim Sylvester 705bdfb3de add noexcepts (#2119)
Co-authored-by: Bart Louwers <bart@emeel.net>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Bart Louwers <bart.louwers@gmail.com>
2024-04-08 15:39:18 +00:00

53 lines
1.7 KiB
C++

#pragma once
#include <mbgl/style/expression/expression.hpp>
#include <mbgl/style/conversion.hpp>
#include <memory>
namespace mbgl {
namespace style {
namespace expression {
class Any : public Expression {
public:
Any(std::vector<std::unique_ptr<Expression>> inputs_)
: Expression(Kind::Any, type::Boolean, collectDependencies(inputs_)),
inputs(std::move(inputs_)) {}
static ParseResult parse(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx);
EvaluationResult evaluate(const EvaluationContext& params) const override;
void eachChild(const std::function<void(const Expression&)>& visit) const override;
bool operator==(const Expression& e) const noexcept override;
std::vector<std::optional<Value>> possibleOutputs() const override;
std::string getOperator() const override { return "any"; }
private:
std::vector<std::unique_ptr<Expression>> inputs;
};
class All : public Expression {
public:
All(std::vector<std::unique_ptr<Expression>> inputs_)
: Expression(Kind::All, type::Boolean, collectDependencies(inputs_)),
inputs(std::move(inputs_)) {}
static ParseResult parse(const mbgl::style::conversion::Convertible& value, ParsingContext& ctx);
EvaluationResult evaluate(const EvaluationContext& params) const override;
void eachChild(const std::function<void(const Expression&)>& visit) const override;
bool operator==(const Expression& e) const noexcept override;
std::vector<std::optional<Value>> possibleOutputs() const override;
std::string getOperator() const override { return "all"; }
private:
std::vector<std::unique_ptr<Expression>> inputs;
};
} // namespace expression
} // namespace style
} // namespace mbgl