LuciadCPillar 2023.1.04
luciad::IFeatureQueryCallback Class Referenceabstract

A callback class that is called with the results of a query. More...

#include <luciad/models/features/IFeatureModel.h>

Public Member Functions

virtual ~IFeatureQueryCallback ()=default
 
virtual bool handleFeature (Feature feature)=0
 Implement this method to handle a feature that is returned by the IFeatureModel::query method. More...
 

Static Public Member Functions

static std::shared_ptr< IFeatureQueryCallbackcreate (std::function< bool(Feature)> function)
 Creates a default IFeatureQueryCallback instance that delegates the IFeatureQueryCallback::handleFeature to the given function. More...
 

Detailed Description

A callback class that is called with the results of a query.

See IFeatureModel::query.

Constructor & Destructor Documentation

◆ ~IFeatureQueryCallback()

virtual luciad::IFeatureQueryCallback::~IFeatureQueryCallback ( )
virtualdefault

Member Function Documentation

◆ create()

static std::shared_ptr< IFeatureQueryCallback > luciad::IFeatureQueryCallback::create ( std::function< bool(Feature)>  function)
static

Creates a default IFeatureQueryCallback instance that delegates the IFeatureQueryCallback::handleFeature to the given function.

This is a convenience method that allows to reduce boiler plate code using lambdas.

Parameters
functionthe function that is called by IFeatureQueryCallback::handleFeature
Returns
an IFeatureQueryCallback instance based on the given function.

◆ handleFeature()

virtual bool luciad::IFeatureQueryCallback::handleFeature ( Feature  feature)
pure virtual

Implement this method to handle a feature that is returned by the IFeatureModel::query method.

Parameters
featurethe feature to handle.
Returns
false to indicate that the query can stop.