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

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

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


namespace osm
{

class Id
{
  uint64_t m_encodedId;

  static const uint64_t INVALID = 0ULL;

public:
  explicit Id(uint64_t encodedId = INVALID);

  static Id Node(uint64_t osmId);
  static Id Way(uint64_t osmId);
  static Id Relation(uint64_t osmId);

  uint64_t OsmId() const;
  bool IsWay() const;

  /// For debug output
  string Type() const;

  bool operator<(Id const & other) const { return m_encodedId < other.m_encodedId; }
  bool operator==(Id const & other) const { return m_encodedId == other.m_encodedId; }
};

string DebugPrint(osm::Id const & id);

} // namespace osm