diff options
author | vng <viktor.govako@gmail.com> | 2011-02-13 15:01:31 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:12:18 +0300 |
commit | fbb107dbaf9b0a708b9513357d0c3d9cf13e190a (patch) | |
tree | 41b2f03f2efc0c62d9d211431ba7b1f713ad2910 /indexer/geometry_coding.hpp | |
parent | 2621e04c6ee7f4f17d43b929b3c66f4e7ef00a36 (diff) |
Replace vector to buffer_vector where possible in feature's geometry Encoding\Decoding.
Diffstat (limited to 'indexer/geometry_coding.hpp')
-rw-r--r-- | indexer/geometry_coding.hpp | 34 |
1 files changed, 18 insertions, 16 deletions
diff --git a/indexer/geometry_coding.hpp b/indexer/geometry_coding.hpp index 215c8aeca5..13700134be 100644 --- a/indexer/geometry_coding.hpp +++ b/indexer/geometry_coding.hpp @@ -1,12 +1,12 @@ #pragma once #include "../geometry/point2d.hpp" + #include "../coding/varint.hpp" + #include "../base/base.hpp" #include "../base/bits.hpp" -#include "../std/vector.hpp" -#include "../std/tuple.hpp" - +#include "../base/array_adapters.h" //@{ inline uint64_t EncodeDelta(m2::PointU const & actual, m2::PointU const & prediction) @@ -45,16 +45,18 @@ m2::PointU PredictPointInTriangle(m2::PointU const & maxPoint, /// Geometry Coding-Decoding functions. namespace geo_coding { - typedef vector<m2::PointU> InPointsT; - typedef vector<m2::PointU> OutPointsT; - typedef vector<uint64_t> DeltasT; + typedef array_read<m2::PointU> InPointsT; + typedef array_write<m2::PointU> OutPointsT; + + typedef array_read<uint64_t> InDeltasT; + typedef array_write<uint64_t> OutDeltasT; void EncodePolylinePrev1(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint, - DeltasT & deltas); + OutDeltasT & deltas); -void DecodePolylinePrev1(DeltasT const & deltas, +void DecodePolylinePrev1(InDeltasT const & deltas, m2::PointU const & basePoint, m2::PointU const & maxPoint, OutPointsT & points); @@ -62,9 +64,9 @@ void DecodePolylinePrev1(DeltasT const & deltas, void EncodePolylinePrev2(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint, - DeltasT & deltas); + OutDeltasT & deltas); -void DecodePolylinePrev2(DeltasT const & deltas, +void DecodePolylinePrev2(InDeltasT const & deltas, m2::PointU const & basePoint, m2::PointU const & maxPoint, OutPointsT & points); @@ -72,9 +74,9 @@ void DecodePolylinePrev2(DeltasT const & deltas, void EncodePolylinePrev3(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint, - DeltasT & deltas); + OutDeltasT & deltas); -void DecodePolylinePrev3(DeltasT const & deltas, +void DecodePolylinePrev3(InDeltasT const & deltas, m2::PointU const & basePoint, m2::PointU const & maxPoint, OutPointsT & points); @@ -82,12 +84,12 @@ void DecodePolylinePrev3(DeltasT const & deltas, inline void EncodePolyline(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint, - DeltasT & deltas) + OutDeltasT & deltas) { EncodePolylinePrev2(points, basePoint, maxPoint, deltas); } -inline void DecodePolyline(DeltasT const & deltas, +inline void DecodePolyline(InDeltasT const & deltas, m2::PointU const & basePoint, m2::PointU const & maxPoint, OutPointsT & points) @@ -98,9 +100,9 @@ inline void DecodePolyline(DeltasT const & deltas, void EncodeTriangleStrip(InPointsT const & points, m2::PointU const & basePoint, m2::PointU const & maxPoint, - DeltasT & deltas); + OutDeltasT & deltas); -void DecodeTriangleStrip(DeltasT const & deltas, +void DecodeTriangleStrip(InDeltasT const & deltas, m2::PointU const & basePoint, m2::PointU const & maxPoint, OutPointsT & points); |