Welcome to mirror list, hosted at ThFree Co, Russian Federation.

mwm_traits.hpp « platform - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 2390efabbc0ad7c25a2494d4af2b27702e3f0df1 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#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<FeatureWithRankAndCenter>.
    FeaturesWithRankAndCenter,

    // A compressed bit vector of feature indices is
    // stored behind every node of the search trie.
    // This format corresponds to ValueList<FeatureIndexValue>.
    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,

    // Elias-Fano based map from feature id to corresponding street feature id.
    EliasFanoMap,

    // The format of relation is unknown. Most likely, an error has occured.
    Unknown
  };

  explicit MwmTraits(MwmVersion const & version);

  SearchIndexFormat GetSearchIndexFormat() const;

  HouseToStreetTableFormat GetHouseToStreetTableFormat() const;

  bool HasOffsetsTable() const;

  bool HasCrossMwmSection() const;

  // The new routing section with IndexGraph was added in december 2016.
  // Check whether mwm has routing index section.
  bool HasRoutingIndex() const;

  bool HasCuisineTypes() const;

private:
  Format GetFormat() const { return m_version.GetFormat(); }
  uint32_t GetVersion() const { return m_version.GetVersion(); }

  MwmVersion m_version;
};

string DebugPrint(MwmTraits::SearchIndexFormat format);
string DebugPrint(MwmTraits::HouseToStreetTableFormat format);
}  // namespace version