libosmscout  0.1
osmscout::FeatureValueBuffer Class Referencefinal

A FeatureValueBuffer is instantiated by an object and holds information about the type of the object, the features and feature values available for the given object. More...

#include <TypeConfig.h>

Public Member Functions

FeatureValueAllocateValue (size_t idx)
 
void ClearFeatureValues ()
 Clears all feature buffer values. More...
 
void CopyMissingValues (const FeatureValueBuffer &other)
 Maintains the current values and types and copies over all not already set feature values of the passed instance to the current instance. More...
 
 FeatureValueBuffer ()=default
 
 FeatureValueBuffer (const FeatureValueBuffer &other)
 
 FeatureValueBuffer (FeatureValueBuffer &&other) noexcept
 
template<class T >
const T * findValue () const
 
void FreeValue (size_t idx)
 
FeatureInstance GetFeature (size_t idx) const
 Get a feature description for the feature with the given index ([0..featureCount[) More...
 
size_t GetFeatureCount () const
 Return the numbe rof features defined for this type. More...
 
TypeInfoRef GetType () const
 
FeatureValueGetValue (size_t idx) const
 Return a raw pointer to the value (as reserved in the internal featureValueBuffer) More...
 
bool HasFeature (size_t idx) const
 Return true, if the given feature is set (available), else false. More...
 
bool operator!= (const FeatureValueBuffer &other) const
 
FeatureValueBufferoperator= (const FeatureValueBuffer &other)
 
FeatureValueBufferoperator= (FeatureValueBuffer &&other) noexcept
 
bool operator== (const FeatureValueBuffer &other) const
 
void Parse (TagErrorReporter &errorReporter, const TagRegistry &tagRegistry, const ObjectOSMRef &object, const TagMap &tags)
 
void Read (FileScanner &scanner)
 Read the FeatureValueBuffer from the given FileScanner. More...
 
void Read (FileScanner &scanner, bool &specialFlag)
 Reads the FeatureValueBuffer to the given FileScanner. More...
 
void Read (FileScanner &scanner, bool &specialFlag1, bool &specialFlag2)
 Reads the FeatureValueBuffer to the given FileScanner. More...
 
void Read (FileScanner &scanner, bool &specialFlag1, bool &specialFlag2, bool &specialFlag3)
 Reads the FeatureValueBuffer to the given FileScanner. More...
 
template<std::size_t FlagCnt>
void Read (FileScanner &scanner, std::array< bool, FlagCnt > &specialFlags)
 Reads the FeatureValueBuffer to the given FileScanner. More...
 
void Set (const FeatureValueBuffer &other)
 Deletes the current feature values and assign the type and values of the passed featur evalue buffer. More...
 
void SetType (const TypeInfoRef &type)
 
void Write (FileWriter &writer) const
 Writes the FeatureValueBuffer to the given FileWriter. More...
 
void Write (FileWriter &writer, bool specialFlag) const
 Writes the FeatureValueBuffer to the given FileWriter. More...
 
void Write (FileWriter &writer, bool specialFlag1, bool specialFlag2) const
 Writes the FeatureValueBuffer to the given FileWriter. More...
 
void Write (FileWriter &writer, bool specialFlag1, bool specialFlag2, bool specialFlag3) const
 Writes the FeatureValueBuffer to the given FileWriter. More...
 
template<std::size_t FlagCnt>
void Write (FileWriter &writer, const std::array< bool, FlagCnt > &specialFlags) const
 Writes the FeatureValueBuffer to the given FileWriter. More...
 
 ~FeatureValueBuffer ()
 

Detailed Description

A FeatureValueBuffer is instantiated by an object and holds information about the type of the object, the features and feature values available for the given object.

Constructor & Destructor Documentation

◆ FeatureValueBuffer() [1/3]

osmscout::FeatureValueBuffer::FeatureValueBuffer ( )
default

◆ FeatureValueBuffer() [2/3]

osmscout::FeatureValueBuffer::FeatureValueBuffer ( const FeatureValueBuffer other)

References Set().

◆ FeatureValueBuffer() [3/3]

osmscout::FeatureValueBuffer::FeatureValueBuffer ( FeatureValueBuffer &&  other)
noexcept

◆ ~FeatureValueBuffer()

osmscout::FeatureValueBuffer::~FeatureValueBuffer ( )

Member Function Documentation

◆ AllocateValue()

◆ ClearFeatureValues()

void osmscout::FeatureValueBuffer::ClearFeatureValues ( )

Clears all feature buffer values.

References FreeValue(), and GetFeatureCount().

◆ CopyMissingValues()

void osmscout::FeatureValueBuffer::CopyMissingValues ( const FeatureValueBuffer other)

Maintains the current values and types and copies over all not already set feature values of the passed instance to the current instance.

Both FeatureValueBuffers do not have to have the same type. Copying is a based on best effort. The copy opperation is expensive.

Parameters
otherinstance to copy missing values from.
Note
Untested!

References AllocateValue(), osmscout::FeatureInstance::GetFeature(), GetFeature(), osmscout::FeatureInstance::GetFeatureBit(), GetFeatureCount(), GetType(), GetValue(), and HasFeature().

Referenced by osmscout::Area::Ring::CopyMissingValues().

◆ findValue()

template<class T >
const T* osmscout::FeatureValueBuffer::findValue ( ) const
inline

◆ FreeValue()

◆ GetFeature()

FeatureInstance osmscout::FeatureValueBuffer::GetFeature ( size_t  idx) const
inline

Get a feature description for the feature with the given index ([0..featureCount[)

References osmscout::FeatureInstance::GetFeature().

Referenced by AllocateValue(), CopyMissingValues(), FreeValue(), operator==(), and Set().

◆ GetFeatureCount()

size_t osmscout::FeatureValueBuffer::GetFeatureCount ( ) const
inline

Return the numbe rof features defined for this type.

Referenced by ClearFeatureValues(), CopyMissingValues(), operator==(), and Set().

◆ GetType()

TypeInfoRef osmscout::FeatureValueBuffer::GetType ( ) const
inline

Referenced by CopyMissingValues(), osmscout::StyleConfig::GetCoastFillStyle(), osmscout::StyleConfig::GetCoastlineLineStyle(), osmscout::Way::GetFeature(), osmscout::Node::GetFeature(), osmscout::Area::Ring::GetFeature(), osmscout::Route::GetFeature(), osmscout::Way::GetFeatureCount(), osmscout::Node::GetFeatureCount(), osmscout::Area::Ring::GetFeatureCount(), osmscout::Route::GetFeatureCount(), osmscout::FeatureReader< F >::GetIndex(), osmscout::FeatureValueReader< NameFeature, NameFeatureValue >::GetIndex(), osmscout::DynamicFeatureLabelReader::GetLabel(), osmscout::FeatureLabelReader< F, V >::GetLabel(), osmscout::StyleConfig::GetLandFillStyle(), osmscout::StyleConfig::GetNodeIconStyle(), osmscout::StyleConfig::GetNodeTextStyleCount(), osmscout::StyleConfig::GetNodeTextStyles(), osmscout::SearchRunnable::GetObjectDetails(), osmscout::SearchRunnable::GetObjectNames(), osmscout::StyleConfig::GetOSMSubTileBorderLineStyle(), osmscout::StyleConfig::GetOSMTileBorderLineStyle(), osmscout::StyleConfig::GetRouteLineStyles(), osmscout::StyleConfig::GetRoutePathTextStyle(), osmscout::StyleConfig::GetSeaFillStyle(), osmscout::Node::GetType(), osmscout::Way::GetType(), osmscout::Area::Ring::GetType(), osmscout::Route::GetType(), osmscout::StyleConfig::GetUnknownFillStyle(), osmscout::DynamicFeatureReader::GetValue(), osmscout::FeatureValueReader< NameFeature, NameFeatureValue >::GetValue(), osmscout::StyleConfig::GetWayLineStyles(), osmscout::StyleConfig::GetWayPathShieldStyle(), osmscout::StyleConfig::GetWayPathSymbolStyle(), osmscout::StyleConfig::GetWayPathTextStyle(), osmscout::Area::Ring::HasAnyFeaturesSet(), osmscout::StyleResolveContext::IsOneway(), osmscout::FeatureReader< F >::IsSet(), osmscout::DynamicFeatureReader::IsSet(), Set(), osmscout::Node::Write(), osmscout::Route::Write(), osmscout::Way::Write(), and osmscout::Way::WriteOptimized().

◆ GetValue()

FeatureValue* osmscout::FeatureValueBuffer::GetValue ( size_t  idx) const
inline

Return a raw pointer to the value (as reserved in the internal featureValueBuffer)

Note: Can return NULL value! HasFeature(idx) && GetFeature(idx).GetFeature()->HasValue() should be called before accessing the value.

Referenced by CopyMissingValues(), FreeValue(), osmscout::Way::GetFeatureValue(), osmscout::Route::GetFeatureValue(), osmscout::DynamicFeatureLabelReader::GetLabel(), osmscout::FeatureLabelReader< F, V >::GetLabel(), osmscout::DynamicFeatureReader::GetValue(), osmscout::FeatureValueReader< NameFeature, NameFeatureValue >::GetValue(), operator==(), and Set().

◆ HasFeature()

◆ operator!=()

bool osmscout::FeatureValueBuffer::operator!= ( const FeatureValueBuffer other) const

References operator==().

◆ operator=() [1/2]

FeatureValueBuffer & osmscout::FeatureValueBuffer::operator= ( const FeatureValueBuffer other)

References Set().

◆ operator=() [2/2]

FeatureValueBuffer & osmscout::FeatureValueBuffer::operator= ( FeatureValueBuffer &&  other)
noexcept

◆ operator==()

bool osmscout::FeatureValueBuffer::operator== ( const FeatureValueBuffer other) const

◆ Parse()

void osmscout::FeatureValueBuffer::Parse ( TagErrorReporter errorReporter,
const TagRegistry tagRegistry,
const ObjectOSMRef object,
const TagMap tags 
)

◆ Read() [1/5]

◆ Read() [2/5]

void osmscout::FeatureValueBuffer::Read ( FileScanner scanner,
bool &  specialFlag 
)

Reads the FeatureValueBuffer to the given FileScanner.

It also reads the value of the special flag as passed to the Write method.

Exceptions
IOException

◆ Read() [3/5]

void osmscout::FeatureValueBuffer::Read ( FileScanner scanner,
bool &  specialFlag1,
bool &  specialFlag2 
)

Reads the FeatureValueBuffer to the given FileScanner.

It also reads the value of two special flags as passed to the Write method.

Exceptions
IOException

◆ Read() [4/5]

void osmscout::FeatureValueBuffer::Read ( FileScanner scanner,
bool &  specialFlag1,
bool &  specialFlag2,
bool &  specialFlag3 
)

Reads the FeatureValueBuffer to the given FileScanner.

It also reads the value of three special flags as passed to the Write method.

Exceptions
IOException

◆ Read() [5/5]

template<std::size_t FlagCnt>
void osmscout::FeatureValueBuffer::Read ( FileScanner scanner,
std::array< bool, FlagCnt > &  specialFlags 
)
inline

Reads the FeatureValueBuffer to the given FileScanner.

It also reads the array of special flags (up to 8) as passed to the Write method.

Exceptions
IOException

References osmscout::BitsToBytes(), osmscout::FeatureValue::Read(), and osmscout::FileScanner::ReadUInt8().

◆ Set()

void osmscout::FeatureValueBuffer::Set ( const FeatureValueBuffer other)

◆ SetType()

◆ Write() [1/5]

void osmscout::FeatureValueBuffer::Write ( FileWriter writer) const

◆ Write() [2/5]

void osmscout::FeatureValueBuffer::Write ( FileWriter writer,
bool  specialFlag 
) const

Writes the FeatureValueBuffer to the given FileWriter.

It also writes the value of the special flag passed. The flag can later be retrieved by using the matching Read method.

Exceptions
IOException

◆ Write() [3/5]

void osmscout::FeatureValueBuffer::Write ( FileWriter writer,
bool  specialFlag1,
bool  specialFlag2 
) const

Writes the FeatureValueBuffer to the given FileWriter.

It also writes the value of the special flag passed. The flag can later be retrieved by using the matching Read method.

Exceptions
IOException

◆ Write() [4/5]

void osmscout::FeatureValueBuffer::Write ( FileWriter writer,
bool  specialFlag1,
bool  specialFlag2,
bool  specialFlag3 
) const

Writes the FeatureValueBuffer to the given FileWriter.

It also writes the value of the special flag passed. The flag can later be retrieved by using the matching Read method.

Exceptions
IOException

◆ Write() [5/5]

template<std::size_t FlagCnt>
void osmscout::FeatureValueBuffer::Write ( FileWriter writer,
const std::array< bool, FlagCnt > &  specialFlags 
) const
inline

Writes the FeatureValueBuffer to the given FileWriter.

It also writes the value of the special flags passed. The flag can later be retrieved by using the matching Read method.

Exceptions
IOException

References osmscout::BitsToBytes(), osmscout::FeatureValue::Write(), and osmscout::FileWriter::Write().


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