forked from organicmaps/organicmaps
Introduced MwmTraits.
This commit is contained in:
parent
0f6d0e5ee1
commit
768d5a5d3a
3 changed files with 13 additions and 13 deletions
|
@ -288,7 +288,7 @@ private:
|
|||
// find out what is stored in the search index than by
|
||||
// staring at the mwm version number. Similar functionality
|
||||
// may be added to it later.
|
||||
class MwmFeatures
|
||||
class MwmTraits
|
||||
{
|
||||
public:
|
||||
enum class SearchIndexFormat
|
||||
|
@ -308,7 +308,7 @@ public:
|
|||
Unknown
|
||||
};
|
||||
|
||||
MwmFeatures(version::Format versionFormat)
|
||||
MwmTraits(version::Format versionFormat)
|
||||
{
|
||||
if (versionFormat < version::v7)
|
||||
{
|
||||
|
|
|
@ -109,16 +109,16 @@ unique_ptr<coding::CompressedBitVector> RetrieveAddressFeatures(MwmSet::MwmHandl
|
|||
LOG(LERROR, ("Unreadable mwm version."));
|
||||
return unique_ptr<coding::CompressedBitVector>();
|
||||
}
|
||||
MwmFeatures mwmFeatures(version.format);
|
||||
MwmTraits mwmTraits(version.format);
|
||||
|
||||
if (mwmFeatures.GetSearchIndexFormat() ==
|
||||
MwmFeatures::SearchIndexFormat::FeaturesWithRankAndCenter)
|
||||
if (mwmTraits.GetSearchIndexFormat() ==
|
||||
MwmTraits::SearchIndexFormat::FeaturesWithRankAndCenter)
|
||||
{
|
||||
using TValue = FeatureWithRankAndCenter;
|
||||
return RetrieveAddressFeaturesImpl<TValue>(handle, cancellable, params);
|
||||
}
|
||||
else if (mwmFeatures.GetSearchIndexFormat() ==
|
||||
MwmFeatures::SearchIndexFormat::CompressedBitVector)
|
||||
else if (mwmTraits.GetSearchIndexFormat() ==
|
||||
MwmTraits::SearchIndexFormat::CompressedBitVector)
|
||||
{
|
||||
using TValue = FeatureIndexValue;
|
||||
return RetrieveAddressFeaturesImpl<TValue>(handle, cancellable, params);
|
||||
|
|
|
@ -1666,21 +1666,21 @@ void Query::SearchLocality(MwmValue const * pMwm, Locality & res1, Region & res2
|
|||
|
||||
auto codingParams = trie::GetCodingParams(pMwm->GetHeader().GetDefCodingParams());
|
||||
|
||||
MwmFeatures mwmFeatures(pMwm->GetHeader().GetFormat());
|
||||
MwmTraits mwmTraits(pMwm->GetHeader().GetFormat());
|
||||
|
||||
if (mwmFeatures.GetSearchIndexFormat() ==
|
||||
MwmFeatures::SearchIndexFormat::FeaturesWithRankAndCenter)
|
||||
if (mwmTraits.GetSearchIndexFormat() ==
|
||||
MwmTraits::SearchIndexFormat::FeaturesWithRankAndCenter)
|
||||
{
|
||||
using TValue = FeatureWithRankAndCenter;
|
||||
SearchLocalityImpl<TValue>(this, pMwm, res1, res2, params, codingParams);
|
||||
}
|
||||
else if (mwmFeatures.GetSearchIndexFormat() ==
|
||||
MwmFeatures::SearchIndexFormat::CompressedBitVector)
|
||||
else if (mwmTraits.GetSearchIndexFormat() ==
|
||||
MwmTraits::SearchIndexFormat::CompressedBitVector)
|
||||
{
|
||||
using TValue = FeatureIndexValue;
|
||||
SearchLocalityImpl<TValue>(this, pMwm, res1, res2, params, codingParams);
|
||||
}
|
||||
else if (mwmFeatures.GetSearchIndexFormat() == MwmFeatures::SearchIndexFormat::Unknown)
|
||||
else if (mwmTraits.GetSearchIndexFormat() == MwmTraits::SearchIndexFormat::Unknown)
|
||||
{
|
||||
LOG(LERROR, ("Unsupported search index format."));
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue