Introduced MwmTraits.

This commit is contained in:
Maxim Pimenov 2015-11-27 14:59:13 +03:00 committed by Sergey Yershov
parent 0f6d0e5ee1
commit 768d5a5d3a
3 changed files with 13 additions and 13 deletions

View file

@ -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)
{

View file

@ -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);

View file

@ -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."));
}