From a038f7cc6b468603d4aa329af830fe45c896fe63 Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Wed, 27 Jan 2016 15:38:02 +0300 Subject: Moved mwm_traits from search to platform. --- platform/mwm_traits.hpp | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 platform/mwm_traits.hpp (limited to 'platform/mwm_traits.hpp') diff --git a/platform/mwm_traits.hpp b/platform/mwm_traits.hpp new file mode 100644 index 0000000000..8f559018b8 --- /dev/null +++ b/platform/mwm_traits.hpp @@ -0,0 +1,53 @@ +#pragma once + +#include "platform/mwm_version.hpp" + +#include "std/string.hpp" + +namespace version +{ +// This is a wrapper around mwm's version. Allows users to get +// information about versions of some data structures in mwm. +class MwmTraits +{ +public: + enum class SearchIndexFormat + { + // A list of features with their ranks and centers + // is stored behind every node of the search trie. + // This format corresponds to ValueList. + FeaturesWithRankAndCenter, + + // A compressed bit vector of feature indices is + // stored behind every node of the search trie. + // This format corresponds to ValueList. + CompressedBitVector, + }; + + enum class HouseToStreetTableFormat + { + // An array of elements where i-th element is an index of a street + // in a vector returned by ReverseGeocoder::GetNearbyStreets() for + // the i-th feature. Each element normally fits into 3 bits, but + // there can be exceptions, and these exceptions are stored in a + // separate table. See ReverseGeocoder and FixedBitsDDVector for + // details. + Fixed3BitsDDVector, + + // The format of relation is unknown. Most likely, an error has occured. + Unknown + }; + + MwmTraits(version::Format versionFormat); + + SearchIndexFormat GetSearchIndexFormat() const; + + HouseToStreetTableFormat GetHouseToStreetTableFormat() const; + +private: + version::Format m_versionFormat; +}; + +string DebugPrint(MwmTraits::SearchIndexFormat format); +string DebugPrint(MwmTraits::HouseToStreetTableFormat format); +} // namespace version -- cgit v1.2.3