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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Yershov <syershov@maps.me>2016-10-31 17:02:56 +0300
committerSergey Yershov <syershov@maps.me>2016-11-01 15:30:27 +0300
commit35e1a79cc5e69457a78113baafc4ae0f2f102848 (patch)
tree6746d29262541810b7087a5063fe4f6b4453271a /coding/traffic.hpp
parentba32a88ce2041928d61702fc38bc00c4a1a0d823 (diff)
Bindings to Python for tracking protocol
Diffstat (limited to 'coding/traffic.hpp')
-rw-r--r--coding/traffic.hpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/coding/traffic.hpp b/coding/traffic.hpp
index c3313358a9..7b237082d5 100644
--- a/coding/traffic.hpp
+++ b/coding/traffic.hpp
@@ -30,6 +30,11 @@ public:
// It is expected that |m_timestamp| stores time since epoch in seconds.
uint64_t m_timestamp = 0;
ms::LatLon m_latLon = ms::LatLon::Zero();
+
+ bool operator==(DataPoint const & p) const
+ {
+ return m_timestamp == p.m_timestamp && m_latLon == p.m_latLon;
+ }
};
// Serializes |points| to |writer| by storing delta-encoded points.
@@ -97,7 +102,7 @@ public:
Uint32ToDouble(ReadVarUint<uint32_t>(src), ms::LatLon::kMinLat, ms::LatLon::kMaxLat);
lastLon =
Uint32ToDouble(ReadVarUint<uint32_t>(src), ms::LatLon::kMinLon, ms::LatLon::kMaxLon);
- result.emplace_back(lastTimestamp, ms::LatLon(lastLat, lastLon));
+ result.push_back(DataPoint(lastTimestamp, ms::LatLon(lastLat, lastLon)));
first = false;
}
else
@@ -105,7 +110,7 @@ public:
lastTimestamp += ReadVarUint<uint64_t>(src);
lastLat += Uint32ToDouble(ReadVarUint<uint32_t>(src), kMinDeltaLat, kMaxDeltaLat);
lastLon += Uint32ToDouble(ReadVarUint<uint32_t>(src), kMinDeltaLon, kMaxDeltaLon);
- result.emplace_back(lastTimestamp, ms::LatLon(lastLat, lastLon));
+ result.push_back(DataPoint(lastTimestamp, ms::LatLon(lastLat, lastLon)));
}
}
}