blob: ba199c06566f453c85a520ac6688bcf8dc8b5f2e (
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
|
#pragma once
#include "std/cstdint.hpp"
#include "std/sstream.hpp"
#include "std/string.hpp"
namespace routing
{
// RoadPoint is a unique identifier for any road point in mwm file.
//
// Contains feature id and point id.
// Point id is the ordinal number of the 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
{
if (m_featureId != rp.m_featureId)
return m_featureId < rp.m_featureId;
return m_pointId < rp.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 << "RoadPoint [" << rp.GetFeatureId() << ", " << rp.GetPointId() << "]";
return out.str();
}
} // namespace routing
|