MapLibre Native Core
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
mbgl::style::expression::CompoundExpression Class Reference

#include <compound_expression.hpp>

Inheritance diagram for mbgl::style::expression::CompoundExpression:
mbgl::style::expression::Expression

Public Member Functions

 CompoundExpression (const detail::SignatureBase &, std::vector< std::unique_ptr< Expression >>)
 
std::string getOperator () const override
 
EvaluationResult evaluate (const EvaluationContext &evaluationParams) const override
 
std::vector< std::optional< Value > > possibleOutputs () const override
 
void eachChild (const std::function< void(const Expression &)> &visit) const override
 
bool operator== (const Expression &e) const override
 
std::optional< std::size_t > getParameterCount () const
 
- Public Member Functions inherited from mbgl::style::expression::Expression
 Expression (Kind kind_, type::Type type_)
 
virtual ~Expression ()=default
 
bool operator!= (const Expression &rhs) const
 
Kind getKind () const
 
type::Type getType () const
 
EvaluationResult evaluate (std::optional< float > zoom, const Feature &feature, std::optional< double > colorRampParameter) const
 
EvaluationResult evaluate (std::optional< float > zoom, const Feature &feature, std::optional< double > colorRampParameter, const std::set< std::string > &availableImages) const
 
EvaluationResult evaluate (std::optional< float > zoom, const Feature &feature, std::optional< double > colorRampParameter, const std::set< std::string > &availableImages, const CanonicalTileID &canonical) const
 
EvaluationResult evaluate (std::optional< mbgl::Value > accumulated, const Feature &feature) const
 
virtual mbgl::Value serialize () const
 

Static Public Member Functions

static bool exists (const std::string &name)
 

Protected Attributes

const detail::SignatureBase & signature
 
std::vector< std::unique_ptr< Expression > > args
 

Additional Inherited Members

- Static Protected Member Functions inherited from mbgl::style::expression::Expression
template<typename T >
static bool childrenEqual (const T &lhs, const T &rhs)
 
static bool childEqual (const std::unique_ptr< Expression > &lhs, const std::unique_ptr< Expression > &rhs)
 
template<typename T >
static bool childEqual (const std::pair< T, std::unique_ptr< Expression >> &lhs, const std::pair< T, std::unique_ptr< Expression >> &rhs)
 
template<typename T >
static bool childEqual (const std::pair< T, std::shared_ptr< Expression >> &lhs, const std::pair< T, std::shared_ptr< Expression >> &rhs)
 
static bool childEqual (const std::pair< std::unique_ptr< Expression >, std::unique_ptr< Expression >> &lhs, const std::pair< std::unique_ptr< Expression >, std::unique_ptr< Expression >> &rhs)
 

Detailed Description

CompoundExpression provides a mechanism for implementing an expression simply by providing a list of pure functions of the form (const T0& arg0, const T1& arg1, ...) -> Result where T0, T1, ..., U are member types of mbgl::style::expression::Value.

The majority of expressions specified in the style-spec are implemented in this fashion (see compound_expression.cpp).

Definition at line 30 of file compound_expression.hpp.

Constructor & Destructor Documentation

◆ CompoundExpression()

mbgl::style::expression::CompoundExpression::CompoundExpression ( const detail::SignatureBase &  ,
std::vector< std::unique_ptr< Expression >>   
)

Member Function Documentation

◆ eachChild()

void mbgl::style::expression::CompoundExpression::eachChild ( const std::function< void(const Expression &)> &  visit) const
overridevirtual

◆ evaluate()

EvaluationResult mbgl::style::expression::CompoundExpression::evaluate ( const EvaluationContext evaluationParams) const
overridevirtual

◆ exists()

static bool mbgl::style::expression::CompoundExpression::exists ( const std::string &  name)
static

◆ getOperator()

std::string mbgl::style::expression::CompoundExpression::getOperator ( ) const
overridevirtual

◆ getParameterCount()

std::optional<std::size_t> mbgl::style::expression::CompoundExpression::getParameterCount ( ) const

◆ operator==()

bool mbgl::style::expression::CompoundExpression::operator== ( const Expression e) const
overridevirtual

◆ possibleOutputs()

std::vector<std::optional<Value> > mbgl::style::expression::CompoundExpression::possibleOutputs ( ) const
overridevirtual

Statically analyze the expression, attempting to enumerate possible outputs. Returns an array of values plus the sentinel null optional value, used to indicate that the complete set of outputs is statically undecidable.

Implements mbgl::style::expression::Expression.

Member Data Documentation

◆ args

std::vector<std::unique_ptr<Expression> > mbgl::style::expression::CompoundExpression::args
protected

Definition at line 46 of file compound_expression.hpp.

◆ signature

const detail::SignatureBase& mbgl::style::expression::CompoundExpression::signature
protected

Definition at line 45 of file compound_expression.hpp.


The documentation for this class was generated from the following file: