blob: f066ffa03a9f7557cf1333108c242c7f05a26ba7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
#include "mwm_traits.hpp"
#include "base/logging.hpp"
namespace version
{
MwmTraits::MwmTraits(MwmVersion const & version) : m_version(version) {}
MwmTraits::SearchIndexFormat MwmTraits::GetSearchIndexFormat() const
{
if (m_version.GetFormat() < version::Format::v7)
return SearchIndexFormat::FeaturesWithRankAndCenter;
return SearchIndexFormat::CompressedBitVector;
}
MwmTraits::HouseToStreetTableFormat MwmTraits::GetHouseToStreetTableFormat() const
{
if (m_version.GetFormat() < version::Format::v7)
return HouseToStreetTableFormat::Unknown;
return HouseToStreetTableFormat::Fixed3BitsDDVector;
}
bool MwmTraits::HasOffsetsTable() const { return m_version.GetFormat() >= version::Format::v6; }
bool MwmTraits::HasRoutingIndex() const
{
uint32_t constexpr kFirstVersionWithRoutingIndex = 161206;
return m_version.GetVersion() >= kFirstVersionWithRoutingIndex;
}
string DebugPrint(MwmTraits::SearchIndexFormat format)
{
switch (format)
{
case MwmTraits::SearchIndexFormat::FeaturesWithRankAndCenter:
return "FeaturesWithRankAndCenter";
case MwmTraits::SearchIndexFormat::CompressedBitVector:
return "CompressedBitVector";
}
}
string DebugPrint(MwmTraits::HouseToStreetTableFormat format)
{
switch (format)
{
case MwmTraits::HouseToStreetTableFormat::Fixed3BitsDDVector:
return "Fixed3BitsDDVector";
case MwmTraits::HouseToStreetTableFormat::Unknown:
return "Unknown";
}
}
} // namespace version
|