LuciadCPillar 2025.0.01
luciad::AttributeResolver Class Referencefinal

Concrete implementation of the luciad::IAttributeResolver. More...

#include <luciad/layers/styles/expressions/IAttributeResolver.h>

Inheritance diagram for luciad::AttributeResolver:
luciad::IAttributeResolver

Public Member Functions

AttributeValue resolve (const Feature &feature) override
 Resolves the attribute value for the provided feature. More...
 
- Public Member Functions inherited from luciad::IAttributeResolver
virtual ~IAttributeResolver ()=default
 
virtual AttributeValue resolve (const Feature &feature)=0
 Resolves the attribute value for the provided feature. More...
 

Static Public Member Functions

static std::shared_ptr< IAttributeResolvercreate (DataPropertyPath propertyPath, double defaultValue)
 Creates an attribute resolver that retrieves a given property from the feature and returns it as attribute value. More...
 
static std::shared_ptr< IAttributeResolvercreate (std::string propertyName, double defaultValue)
 Creates an attribute resolver that retrieves a given property from the feature and returns it as attribute value. More...
 
- Static Public Member Functions inherited from luciad::IAttributeResolver
static std::shared_ptr< IAttributeResolvercreate (std::function< AttributeValue(const Feature &)> resolverFn)
 Creates an attribute resolver that delegates the retrieval or computation of the attribute value to a given function. More...
 

Detailed Description

Concrete implementation of the luciad::IAttributeResolver.

You can provide attribute resolvers when creating attribute style expressions using luciad::StyleExpressionFactory::doubleAttribute, luciad::StyleExpressionFactory::colorAttribute or luciad::StyleExpressionFactory::coordinateAttribute.

Since
2025.0

Member Function Documentation

◆ create() [1/2]

static std::shared_ptr< IAttributeResolver > luciad::AttributeResolver::create ( DataPropertyPath  propertyPath,
double  defaultValue 
)
static

Creates an attribute resolver that retrieves a given property from the feature and returns it as attribute value.

The property must be of one of the following types: int32_t, int64_t, float, double. The resulting attribute value will be of type double.

Parameters
propertyPaththe path to the property within the feature.
defaultValuedefault value returned by the resolver if the property is not present.
Returns
The attribute resolver.

◆ create() [2/2]

static std::shared_ptr< IAttributeResolver > luciad::AttributeResolver::create ( std::string  propertyName,
double  defaultValue 
)
static

Creates an attribute resolver that retrieves a given property from the feature and returns it as attribute value.

The property must be of one of the following types: int32_t, int64_t, float, double. The resulting attribute value will be of type double.

Parameters
propertyNamename of the property within the feature.
defaultValuedefault value returned by the resolver if the property is not present.
Returns
the attribute resolver.

◆ resolve()

AttributeValue luciad::AttributeResolver::resolve ( const Feature feature)
overridevirtual

Resolves the attribute value for the provided feature.

Parameters
featurethe feature for which the attribute value should be resolved.
Returns
the attribute value for the given feature.

Implements luciad::IAttributeResolver.