|
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. | |
| 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. | |
| 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[). | |
| size_t | GetFeatureCount () const |
| Return the numbe rof features defined for this type. | |
| TypeInfoRef | GetType () const |
| FeatureValue * | GetValue (size_t idx) const |
| Return a raw pointer to the value (as reserved in the internal featureValueBuffer). | |
| bool | HasFeature (size_t idx) const |
| Return true, if the given feature is set (available), else false. | |
| 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. | |
| void | Read (FileScanner &scanner, bool &specialFlag) |
| Reads the FeatureValueBuffer to the given FileScanner. | |
| void | Read (FileScanner &scanner, bool &specialFlag1, bool &specialFlag2) |
| Reads the FeatureValueBuffer to the given FileScanner. | |
| void | Read (FileScanner &scanner, bool &specialFlag1, bool &specialFlag2, bool &specialFlag3) |
| Reads the FeatureValueBuffer to the given FileScanner. | |
| template<std::size_t FlagCnt> | |
| void | Read (FileScanner &scanner, std::array< bool, FlagCnt > &specialFlags) |
| Reads the FeatureValueBuffer to the given FileScanner. | |
| void | Set (const FeatureValueBuffer &other) |
| Deletes the current feature values and assign the type and values of the passed featur evalue buffer. | |
| void | SetType (const TypeInfoRef &type) |
| void | Write (FileWriter &writer) const |
| Writes the FeatureValueBuffer to the given FileWriter. | |
| void | Write (FileWriter &writer, bool specialFlag) const |
| Writes the FeatureValueBuffer to the given FileWriter. | |
| void | Write (FileWriter &writer, bool specialFlag1, bool specialFlag2) const |
| Writes the FeatureValueBuffer to the given FileWriter. | |
| void | Write (FileWriter &writer, bool specialFlag1, bool specialFlag2, bool specialFlag3) const |
| Writes the FeatureValueBuffer to the given FileWriter. | |
| template<std::size_t FlagCnt> | |
| void | Write (FileWriter &writer, const std::array< bool, FlagCnt > &specialFlags) const |
| Writes the FeatureValueBuffer to the given FileWriter. | |
| ~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 |
References ClearFeatureValues(), CopyMissingValues(), FeatureValueBuffer(), operator=(), Set(), and SetType().
Referenced by CopyMissingValues(), FeatureValueBuffer(), FeatureValueBuffer(), FeatureValueBuffer(), operator!=(), operator=(), operator=(), operator==(), and Set().
| osmscout::FeatureValueBuffer::FeatureValueBuffer | ( | const FeatureValueBuffer & | other | ) |
References FeatureValueBuffer(), and Set().
|
noexcept |
References FeatureValueBuffer().
| osmscout::FeatureValueBuffer::~FeatureValueBuffer | ( | ) |
| FeatureValue * osmscout::FeatureValueBuffer::AllocateValue | ( | size_t | idx | ) |
References GetFeature(), and osmscout::FeatureInstance::GetFeatureBit().
Referenced by CopyMissingValues(), osmscout::AccessFeature::Parse(), osmscout::AccessRestrictedFeature::Parse(), osmscout::AddressFeature::Parse(), osmscout::AdminLevelFeature::Parse(), osmscout::BrandFeature::Parse(), osmscout::BridgeFeature::Parse(), osmscout::BuildingFeature::Parse(), osmscout::ChargingStationFeature::Parse(), osmscout::ClockwiseDirectionFeature::Parse(), osmscout::ColorFeature::Parse(), osmscout::ConstructionYearFeature::Parse(), osmscout::DestinationFeature::Parse(), osmscout::EleFeature::Parse(), osmscout::EmbankmentFeature::Parse(), osmscout::FeeFeature::Parse(), osmscout::FromToFeature::Parse(), osmscout::GradeFeature::Parse(), osmscout::HighwayMilestoneFeature::Parse(), osmscout::IsInFeature::Parse(), osmscout::LanesFeature::Parse(), osmscout::LayerFeature::Parse(), osmscout::LocationFeature::Parse(), osmscout::MaxSpeedFeature::Parse(), osmscout::MaxStayFeature::Parse(), osmscout::NameAltFeature::Parse(), osmscout::NameFeature::Parse(), osmscout::NameShortFeature::Parse(), osmscout::NetworkFeature::Parse(), osmscout::OpeningHoursFeature::Parse(), osmscout::OperatorFeature::Parse(), osmscout::PhoneFeature::Parse(), osmscout::PostalCodeFeature::Parse(), osmscout::RefFeature::Parse(), osmscout::RoundaboutFeature::Parse(), osmscout::SidewayFeature::Parse(), osmscout::TunnelFeature::Parse(), osmscout::WebsiteFeature::Parse(), osmscout::WidthFeature::Parse(), Set(), and osmscout::OverlayObject::setupFeatures().
| void osmscout::FeatureValueBuffer::ClearFeatureValues | ( | ) |
Clears all feature buffer values.
References FreeValue(), and GetFeatureCount().
Referenced by FeatureValueBuffer().
| 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(), FeatureValueBuffer(), osmscout::FeatureInstance::GetFeature(), GetFeature(), osmscout::FeatureInstance::GetFeatureBit(), GetFeatureCount(), GetType(), GetValue(), and HasFeature().
Referenced by FeatureValueBuffer().
|
inline |
References GetType(), GetValue(), and HasFeature().
| void osmscout::FeatureValueBuffer::FreeValue | ( | size_t | idx | ) |
References GetFeature(), osmscout::FeatureInstance::GetFeatureBit(), GetValue(), HasFeature(), and osmscout::FeatureValue::~FeatureValue().
Referenced by ClearFeatureValues().
|
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(), findValue(), osmscout::FeatureToDescriptionProcessor::GetFeatureValue(), osmscout::FeatureReader< F >::GetIndex(), osmscout::FeatureValueReader< F, V >::GetIndex(), osmscout::DynamicFeatureLabelReader::GetLabel(), osmscout::FeatureLabelReader< F, V >::GetLabel(), osmscout::StyleConfig::GetNodeIconStyle(), osmscout::StyleConfig::GetNodeTextStyleCount(), osmscout::StyleConfig::GetNodeTextStyles(), osmscout::SearchRunnable::GetObjectDetails(), osmscout::SearchRunnable::GetObjectNames(), osmscout::StyleConfig::GetRouteLineStyles(), osmscout::StyleConfig::GetRoutePathTextStyle(), osmscout::DynamicFeatureReader::GetValue(), osmscout::FeatureValueReader< F, V >::GetValue(), osmscout::FeatureValueReader< F, V >::GetValue(), osmscout::StyleConfig::GetWayLineStyles(), osmscout::StyleConfig::GetWayPathShieldStyle(), osmscout::StyleConfig::GetWayPathSymbolStyle(), osmscout::StyleConfig::GetWayPathTextStyle(), osmscout::StyleResolveContext::IsOneway(), osmscout::DynamicFeatureReader::IsSet(), osmscout::FeatureReader< F >::IsSet(), osmscout::GeneralDescriptionProcessor::Process(), and Set().
|
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(), findValue(), FreeValue(), osmscout::FeatureToDescriptionProcessor::GetFeatureValue(), osmscout::DynamicFeatureLabelReader::GetLabel(), osmscout::FeatureLabelReader< F, V >::GetLabel(), osmscout::DynamicFeatureReader::GetValue(), osmscout::FeatureValueReader< F, V >::GetValue(), osmscout::FeatureValueReader< F, V >::GetValue(), operator==(), Set(), and Write().
|
inline |
Return true, if the given feature is set (available), else false.
Referenced by CopyMissingValues(), findValue(), FreeValue(), osmscout::FeatureToDescriptionProcessor::GetFeatureValue(), osmscout::DynamicFeatureLabelReader::GetLabel(), osmscout::FeatureLabelReader< F, V >::GetLabel(), osmscout::FeatureValueReader< F, V >::GetValue(), osmscout::FeatureValueReader< F, V >::GetValue(), osmscout::DynamicFeatureReader::IsSet(), osmscout::FeatureReader< F >::IsSet(), operator==(), Read(), Set(), and Write().
| bool osmscout::FeatureValueBuffer::operator!= | ( | const FeatureValueBuffer & | other | ) | const |
References FeatureValueBuffer(), and operator==().
| FeatureValueBuffer & osmscout::FeatureValueBuffer::operator= | ( | const FeatureValueBuffer & | other | ) |
References FeatureValueBuffer(), and Set().
Referenced by FeatureValueBuffer().
|
noexcept |
References FeatureValueBuffer().
| bool osmscout::FeatureValueBuffer::operator== | ( | const FeatureValueBuffer & | other | ) | const |
References FeatureValueBuffer(), 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 |
References Read().
Referenced by osmscout::Area::Read(), Read(), Read(), Read(), Read(), osmscout::Area::ReadImport(), 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 |
References Read().
| 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 |
References Read().
| 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 |
References Read().
|
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(), HasFeature(), 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(), FeatureValueBuffer(), osmscout::FeatureInstance::GetFeature(), GetFeature(), osmscout::FeatureInstance::GetFeatureBit(), GetFeatureCount(), GetType(), GetValue(), HasFeature(), and SetType().
Referenced by FeatureValueBuffer(), FeatureValueBuffer(), and operator=().
| void osmscout::FeatureValueBuffer::SetType | ( | const TypeInfoRef & | type | ) |
| void osmscout::FeatureValueBuffer::Write | ( | FileWriter & | writer | ) | const |
| 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 |
References Write().
| 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 |
References Write().
| 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 |
References Write().
|
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(), GetValue(), HasFeature(), osmscout::FeatureValue::Write(), and osmscout::FileWriter::Write().