libosmscout
0.1
|
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 | |
FeatureValue * | AllocateValue (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 |
FeatureValue * | GetValue (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 |
FeatureValueBuffer & | operator= (const FeatureValueBuffer &other) |
FeatureValueBuffer & | operator= (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 () | |
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.
|
default |
osmscout::FeatureValueBuffer::FeatureValueBuffer | ( | const FeatureValueBuffer & | other | ) |
References Set().
|
noexcept |
osmscout::FeatureValueBuffer::~FeatureValueBuffer | ( | ) |
FeatureValue * osmscout::FeatureValueBuffer::AllocateValue | ( | size_t | idx | ) |
References GetFeature(), and osmscout::FeatureInstance::GetFeatureBit().
Referenced by CopyMissingValues(), osmscout::BridgeFeature::Parse(), osmscout::ClockwiseDirectionFeature::Parse(), osmscout::RoundaboutFeature::Parse(), osmscout::TunnelFeature::Parse(), osmscout::BuildingFeature::Parse(), osmscout::EmbankmentFeature::Parse(), osmscout::LayerFeature::Parse(), osmscout::WidthFeature::Parse(), osmscout::GradeFeature::Parse(), osmscout::IsInFeature::Parse(), osmscout::MaxSpeedFeature::Parse(), osmscout::NameAltFeature::Parse(), osmscout::NameFeature::Parse(), osmscout::RefFeature::Parse(), osmscout::NameShortFeature::Parse(), osmscout::WebsiteFeature::Parse(), osmscout::OperatorFeature::Parse(), osmscout::NetworkFeature::Parse(), osmscout::BrandFeature::Parse(), osmscout::OpeningHoursFeature::Parse(), osmscout::AdminLevelFeature::Parse(), osmscout::PostalCodeFeature::Parse(), osmscout::ColorFeature::Parse(), osmscout::LocationFeature::Parse(), osmscout::DestinationFeature::Parse(), osmscout::PhoneFeature::Parse(), osmscout::MaxStayFeature::Parse(), osmscout::AddressFeature::Parse(), osmscout::EleFeature::Parse(), osmscout::ConstructionYearFeature::Parse(), osmscout::FeeFeature::Parse(), osmscout::ChargingStationFeature::Parse(), osmscout::FromToFeature::Parse(), osmscout::SidewayFeature::Parse(), osmscout::AccessRestrictedFeature::Parse(), osmscout::LanesFeature::Parse(), osmscout::AccessFeature::Parse(), Set(), and osmscout::OverlayObject::setupFeatures().
void osmscout::FeatureValueBuffer::ClearFeatureValues | ( | ) |
Clears all feature buffer values.
References FreeValue(), and GetFeatureCount().
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.
other | instance to copy missing values from. |
References AllocateValue(), osmscout::FeatureInstance::GetFeature(), GetFeature(), osmscout::FeatureInstance::GetFeatureBit(), GetFeatureCount(), GetType(), GetValue(), and HasFeature().
Referenced by osmscout::Area::Ring::CopyMissingValues().
|
inline |
void osmscout::FeatureValueBuffer::FreeValue | ( | size_t | idx | ) |
References GetFeature(), osmscout::FeatureInstance::GetFeatureBit(), GetValue(), HasFeature(), and osmscout::FeatureValue::~FeatureValue().
Referenced by ClearFeatureValues(), osmscout::Way::UnsetFeature(), osmscout::Node::UnsetFeature(), osmscout::Area::Ring::UnsetFeature(), and osmscout::Route::UnsetFeature().
|
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().
|
inline |
Return the numbe rof features defined for this type.
Referenced by ClearFeatureValues(), CopyMissingValues(), operator==(), and Set().
|
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::FeatureToDescriptionProcessor::GetFeatureValue(), 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(), osmscout::GeneralDescriptionProcessor::Process(), Set(), osmscout::Node::Write(), osmscout::Route::Write(), osmscout::Way::Write(), and osmscout::Way::WriteOptimized().
|
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::FeatureToDescriptionProcessor::GetFeatureValue(), osmscout::Route::GetFeatureValue(), osmscout::DynamicFeatureLabelReader::GetLabel(), osmscout::FeatureLabelReader< F, V >::GetLabel(), osmscout::DynamicFeatureReader::GetValue(), osmscout::FeatureValueReader< NameFeature, NameFeatureValue >::GetValue(), operator==(), and Set().
|
inline |
Return true, if the given feature is set (available), else false.
Referenced by CopyMissingValues(), FreeValue(), osmscout::FeatureToDescriptionProcessor::GetFeatureValue(), osmscout::DynamicFeatureLabelReader::GetLabel(), osmscout::FeatureLabelReader< F, V >::GetLabel(), osmscout::FeatureValueReader< NameFeature, NameFeatureValue >::GetValue(), osmscout::Area::Ring::HasAnyFeaturesSet(), osmscout::Way::HasFeature(), osmscout::Node::HasFeature(), osmscout::Area::Ring::HasFeature(), osmscout::Route::HasFeature(), osmscout::FeatureReader< F >::IsSet(), osmscout::DynamicFeatureReader::IsSet(), operator==(), and Set().
bool osmscout::FeatureValueBuffer::operator!= | ( | const FeatureValueBuffer & | other | ) | const |
References operator==().
FeatureValueBuffer & osmscout::FeatureValueBuffer::operator= | ( | const FeatureValueBuffer & | other | ) |
References Set().
|
noexcept |
bool osmscout::FeatureValueBuffer::operator== | ( | const FeatureValueBuffer & | other | ) | const |
References osmscout::FeatureInstance::GetFeature(), GetFeature(), GetFeatureCount(), GetValue(), and HasFeature().
Referenced by operator!=().
void osmscout::FeatureValueBuffer::Parse | ( | TagErrorReporter & | errorReporter, |
const TagRegistry & | tagRegistry, | ||
const ObjectOSMRef & | object, | ||
const TagMap & | tags | ||
) |
void osmscout::FeatureValueBuffer::Read | ( | FileScanner & | scanner | ) |
Read the FeatureValueBuffer from the given FileScanner.
IOException |
Referenced by osmscout::Node::Read(), osmscout::Route::Read(), osmscout::Way::Read(), osmscout::Area::Read(), osmscout::Area::ReadImport(), osmscout::Way::ReadOptimized(), and osmscout::Area::ReadOptimized().
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.
IOException |
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.
IOException |
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.
IOException |
|
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.
IOException |
References osmscout::BitsToBytes(), osmscout::FeatureValue::Read(), and osmscout::FileScanner::ReadUInt8().
void osmscout::FeatureValueBuffer::Set | ( | const FeatureValueBuffer & | other | ) |
Deletes the current feature values and assign the type and values of the passed featur evalue buffer.
other | Other FeatureValueBuffer to make a copy of |
References AllocateValue(), osmscout::FeatureInstance::GetFeature(), GetFeature(), osmscout::FeatureInstance::GetFeatureBit(), GetFeatureCount(), GetType(), GetValue(), HasFeature(), and SetType().
Referenced by FeatureValueBuffer(), operator=(), osmscout::Node::SetFeatures(), osmscout::Route::SetFeatures(), osmscout::Way::SetFeatures(), and osmscout::Area::Ring::SetFeatures().
void osmscout::FeatureValueBuffer::SetType | ( | const TypeInfoRef & | type | ) |
Referenced by osmscout::MapPainter::DrawContourLines(), osmscout::MapPainter::DrawHillShading(), osmscout::Node::Read(), osmscout::Route::Read(), osmscout::Way::Read(), osmscout::Area::Read(), osmscout::Area::ReadImport(), osmscout::Way::ReadOptimized(), osmscout::Area::ReadOptimized(), Set(), osmscout::Node::SetType(), osmscout::Route::SetType(), osmscout::Way::SetType(), osmscout::Area::Ring::SetType(), osmscout::OverlayObject::setupFeatures(), and osmscout::StyleConfig::StyleConfig().
void osmscout::FeatureValueBuffer::Write | ( | FileWriter & | writer | ) | const |
Writes the FeatureValueBuffer to the given FileWriter.
IOException |
Referenced by osmscout::Node::Write(), osmscout::Route::Write(), osmscout::Way::Write(), and osmscout::Way::WriteOptimized().
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.
IOException |
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.
IOException |
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.
IOException |
|
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.
IOException |
References osmscout::BitsToBytes(), osmscout::FeatureValue::Write(), and osmscout::FileWriter::Write().