libosmscout  1.1.1
Public Member Functions | Protected Member Functions | List of all members
osmscout::Feature Class Referenceabstract

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

Inheritance diagram for osmscout::Feature:
Inheritance graph
[legend]

Public Member Functions

 Feature ()=default
 
virtual ~Feature ()=default
 
virtual void Initialize (TagRegistry &tagRegistry)=0
 
void AddDescription (const std::string &languageCode, const std::string &description)
 
virtual std::string GetName () const =0
 
virtual size_t GetValueAlignment () const
 
virtual size_t GetValueSize () const
 
virtual size_t GetFeatureBitCount () const
 
virtual bool HasValue () const
 
virtual bool HasLabel () const
 
virtual bool HasFlags () const
 
bool GetLabelIndex (const std::string &labelName, size_t &index) const
 
bool GetFlagIndex (const std::string &flagName, size_t &index) const
 
std::string GetDescription (const std::string &languageCode) const
 
const std::unordered_map< std::string, std::string > & GetDescriptions () const
 
virtual FeatureValueAllocateValue (void *buffer)
 
virtual void Parse (TagErrorReporter &reporter, const TagRegistry &tagRegistry, const FeatureInstance &feature, const ObjectOSMRef &object, const TagMap &tags, FeatureValueBuffer &buffer) const =0
 

Protected Member Functions

void RegisterLabel (size_t index, const std::string &labelName)
 
void RegisterFlag (size_t index, const std::string &flagName)
 

Detailed Description

A feature combines one or multiple tags to build information attribute for a type.

The class "Feature" is the abstract base class for a concrete feature implementation like "NameFeature" or "AccessFeature".

A feature could just be an alias for one tag (like "name") but it could also combine a number of attributes (e.g. access and all its variations).

Constructor & Destructor Documentation

◆ Feature()

osmscout::Feature::Feature ( )
default

◆ ~Feature()

virtual osmscout::Feature::~Feature ( )
virtualdefault

Member Function Documentation

◆ AddDescription()

void osmscout::Feature::AddDescription ( const std::string &  languageCode,
const std::string &  description 
)

◆ AllocateValue()

virtual FeatureValue* osmscout::Feature::AllocateValue ( void *  buffer)
virtual

◆ GetDescription()

std::string osmscout::Feature::GetDescription ( const std::string &  languageCode) const

◆ GetDescriptions()

const std::unordered_map<std::string,std::string>& osmscout::Feature::GetDescriptions ( ) const
inline

◆ GetFeatureBitCount()

virtual size_t osmscout::Feature::GetFeatureBitCount ( ) const
inlinevirtual

This method returns the number of additional feature bits reserved. If there are additional features bit, 0 is returned.

A feature may reserve additional feature bits. Feature bits should be used if a custom value object is too expensive. Space for feature bits is always reserved even if the feature itself is not set for a certain object.

◆ GetFlagIndex()

bool osmscout::Feature::GetFlagIndex ( const std::string &  flagName,
size_t &  index 
) const

Returns the index of the feature flag with the given name. Method returns 'true' if the feature has the named flag. Else 'false' is returned.

◆ GetLabelIndex()

bool osmscout::Feature::GetLabelIndex ( const std::string &  labelName,
size_t &  index 
) const

Returns the index of the label with the given name. Method returns 'true' if the feature has labels and a label with the given name exists. Else 'false' is returned.

◆ GetName()

virtual std::string osmscout::Feature::GetName ( ) const
pure virtual

◆ GetValueAlignment()

virtual size_t osmscout::Feature::GetValueAlignment ( ) const
inlinevirtual

◆ GetValueSize()

virtual size_t osmscout::Feature::GetValueSize ( ) const
inlinevirtual

◆ HasFlags()

virtual bool osmscout::Feature::HasFlags ( ) const
inlinevirtual

Returns 'true' if the feature provides flags.

◆ HasLabel()

virtual bool osmscout::Feature::HasLabel ( ) const
inlinevirtual

Returns 'true' if the feature provides labels.

◆ HasValue()

virtual bool osmscout::Feature::HasValue ( ) const
inlinevirtual

Returns 'true' if the feature has an value object.

◆ Initialize()

virtual void osmscout::Feature::Initialize ( TagRegistry &  tagRegistry)
pure virtual

◆ Parse()

virtual void osmscout::Feature::Parse ( TagErrorReporter reporter,
const TagRegistry &  tagRegistry,
const FeatureInstance &  feature,
const ObjectOSMRef &  object,
const TagMap tags,
FeatureValueBuffer &  buffer 
) const
pure virtual

◆ RegisterFlag()

void osmscout::Feature::RegisterFlag ( size_t  index,
const std::string &  flagName 
)
protected

◆ RegisterLabel()

void osmscout::Feature::RegisterLabel ( size_t  index,
const std::string &  labelName 
)
protected

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