|
libosmscout 0.1
|
Helper template class for easy access to flag-like Features. More...
#include <FeatureReader.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. | |
| bool | IsSet (const FeatureValueBuffer &buffer) const |
| Returns true, if the feature is set for the given FeatureValueBuffer. | |
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.
|
explicit |
| bool osmscout::FeatureReader< F >::GetIndex | ( | const FeatureValueBuffer & | buffer, |
| size_t & | index | ||
| ) | const |
Returns the index of the Feature/FeatureValue within the given FeatureValueBuffer.
| buffer | The FeatureValueBuffer instance |
| index | The index |
References osmscout::FeatureValueBuffer::GetType().
| bool osmscout::FeatureReader< F >::IsSet | ( | const FeatureValueBuffer & | buffer | ) | const |
Returns true, if the feature is set for the given FeatureValueBuffer.
| buffer | The FeatureValueBuffer instance |
References osmscout::FeatureValueBuffer::GetType(), and osmscout::FeatureValueBuffer::HasFeature().