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

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

#include "indexer/mwm_set.hpp"

#include "std/cstdint.hpp"
#include "std/string.hpp"
#include "std/utility.hpp"

namespace feature
{
enum EGeomType
{
  GEOM_UNDEFINED = -1,
  // Note! do not change this values. Should be equal with FeatureGeoType.
  GEOM_POINT = 0,
  GEOM_LINE = 1,
  GEOM_AREA = 2
};
}  // namespace feature

string DebugPrint(feature::EGeomType type);

struct FeatureID
{
  static char const * const kInvalidFileName;
  static int64_t const kInvalidMwmVersion;

  MwmSet::MwmId m_mwmId;
  uint32_t m_index;

  FeatureID() : m_index(0) {}
  FeatureID(MwmSet::MwmId const & mwmId, uint32_t index) : m_mwmId(mwmId), m_index(index) {}

  bool IsValid() const { return m_mwmId.IsAlive(); }

  inline bool operator<(FeatureID const & r) const
  {
    if (m_mwmId == r.m_mwmId)
      return m_index < r.m_index;
    else
      return m_mwmId < r.m_mwmId;
  }

  inline bool operator==(FeatureID const & r) const
  {
    return (m_mwmId == r.m_mwmId && m_index == r.m_index);
  }

  inline bool operator!=(FeatureID const & r) const { return !(*this == r); }

  string GetMwmName() const;
  int64_t GetMwmVersion() const;

  friend string DebugPrint(FeatureID const & id);
};