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

model.hpp « search - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 840044e0b78c6e234b6252da0c8964fd7dd2d68e (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
#pragma once

#include "indexer/ftypes_matcher.hpp"

#include "base/macros.hpp"

#include <string>

class FeatureType;

namespace search
{
/// Describes 2-level POI-exception types that don't belong to any POI-common classes
/// (amenity, shop, tourism, ...). Used in search algo and search categories index generation.
class TwoLevelPOIChecker : public ftypes::BaseChecker
{
public:
  TwoLevelPOIChecker();
};

// This class is used to map feature types to a restricted set of
// different search classes (do not confuse these classes with search
// categories - they are completely different things).
class Model
{
public:
  // WARNING: after modifications to the enum below, re-check all methods in the class.
  enum Type
  {
    // Low-level features such as amenities, offices, shops, buildings without house number, etc.
    // Can be stand-alone or located inside COMPLEX_POIs. E.g. cafes/shops inside
    // airports/universities/museums.
    TYPE_SUBPOI,

    // Big pois which can contain SUBPOIs. E.g. airports, train stations, malls, parks.
    TYPE_COMPLEX_POI,

    // All features with set house number.
    TYPE_BUILDING,

    TYPE_STREET,
    TYPE_SUBURB,

    // All low-level features except POI, BUILDING and STREET.
    TYPE_UNCLASSIFIED,

    TYPE_VILLAGE,
    TYPE_CITY,
    TYPE_STATE,  // US or Canadian states
    TYPE_COUNTRY,

    TYPE_COUNT
  };

  static bool IsLocalityType(Type const type)
  {
    return type >= TYPE_VILLAGE && type <= TYPE_COUNTRY;
  }

  static bool IsPoi(Type const type) { return type == TYPE_SUBPOI || type == TYPE_COMPLEX_POI; }

  Type GetType(FeatureType & feature) const;
};

std::string DebugPrint(Model::Type type);
}  // namespace search