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

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

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

namespace routing
{
// RoadPoint in unique identifier for any road point in mwm file.
//
// Contains feature id and point id.
// Point id is the ordinal number of point in the road.
class RoadPoint final
{
public:
  RoadPoint() : m_featureId(0), m_pointId(0) {}

  RoadPoint(uint32_t featureId, uint32_t pointId) : m_featureId(featureId), m_pointId(pointId) {}

  uint32_t GetFeatureId() const { return m_featureId; }

  uint32_t GetPointId() const { return m_pointId; }

  bool operator==(RoadPoint const & rp) const
  {
    return m_featureId == rp.m_featureId && m_pointId == rp.m_pointId;
  }

  bool operator!=(RoadPoint const & rp) const
  {
    return !(*this == rp);
  }

private:
  uint32_t m_featureId;
  uint32_t m_pointId;
};

inline string DebugPrint(RoadPoint const & rp)
{
  ostringstream out;
  out << "rp("
      << "(" << rp.GetFeatureId() << ", " << rp.GetPointId() << ")";
  return out.str();
}
}  // namespace routing