libosmscout  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups
osmscout::FeatureReader< F > Class Template Reference

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

#include <TypeFeatures.h>

Public Member Functions

 FeatureReader (const TypeConfig &typeConfig)
 
bool GetIndex (const FeatureValueBuffer &buffer, size_t &index) const
 Returns the index of the Feature/FeatureValue within the given FeatureValueBuffer. More...
 
bool IsSet (const FeatureValueBuffer &buffer) const
 Returns true, if the feature is set for the given FeatureValueBuffer. More...
 

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

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

Member Function Documentation

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
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: