libosmscout 1.1.1
Loading...
Searching...
No Matches
osmscout::FeatureReader< F > Class Template Reference

#include <libosmscout/include/osmscout/FeatureReader.h>

Public Member Functions

 FeatureReader (const TypeConfig &typeConfig)
bool GetIndex (const FeatureValueBuffer &buffer, size_t &index) const
bool IsSet (const FeatureValueBuffer &buffer) const

Detailed Description

template<class F>
class osmscout::FeatureReader< F >

Helper template class for easy access to flag-like Features.

Each type may have stored the feature in request at a different index. The FeatureReader caches the index for each type once in the constructor and later on allows access to the feature in O(1) - without iterating of all feature(values) of an object.

Constructor & Destructor Documentation

◆ FeatureReader()

template<class F>
osmscout::FeatureReader< F >::FeatureReader ( const TypeConfig & typeConfig)
explicit

Member Function Documentation

◆ GetIndex()

template<class F>
bool osmscout::FeatureReader< F >::GetIndex ( const FeatureValueBuffer & buffer,
size_t & index ) const

Returns the index of the Feature/FeatureValue within the given FeatureValueBuffer.

Parameters
bufferThe FeatureValueBuffer instance
indexThe index
Returns
true, if there is a valid index 8because the type has such feature), else false

◆ IsSet()

template<class F>
bool osmscout::FeatureReader< F >::IsSet ( const FeatureValueBuffer & buffer) const

Returns true, if the feature is set for the given FeatureValueBuffer

Parameters
bufferThe FeatureValueBuffer instance
Returns
true if set, else false

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