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:
authorvng <viktor.govako@gmail.com>2011-02-13 15:01:31 +0300
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:12:18 +0300
commitfbb107dbaf9b0a708b9513357d0c3d9cf13e190a (patch)
tree41b2f03f2efc0c62d9d211431ba7b1f713ad2910 /indexer/geometry_serialization.hpp
parent2621e04c6ee7f4f17d43b929b3c66f4e7ef00a36 (diff)
Replace vector to buffer_vector where possible in feature's geometry Encoding\Decoding.
Diffstat (limited to 'indexer/geometry_serialization.hpp')
-rw-r--r--indexer/geometry_serialization.hpp25
1 files changed, 14 insertions, 11 deletions
diff --git a/indexer/geometry_serialization.hpp b/indexer/geometry_serialization.hpp
index fe42a4b772..134388f0e3 100644
--- a/indexer/geometry_serialization.hpp
+++ b/indexer/geometry_serialization.hpp
@@ -18,8 +18,8 @@
namespace serial
{
- template <class T, class TSink>
- inline void WriteVarUintArray(vector<T> const & v, TSink & sink)
+ template <class TCont, class TSink>
+ inline void WriteVarUintArray(TCont const & v, TSink & sink)
{
for (size_t i = 0; i != v.size(); ++i)
WriteVarUint(sink, v[i]);
@@ -27,18 +27,21 @@ namespace serial
namespace pts { m2::PointU D2U(m2::PointD const & p); }
- typedef vector<m2::PointU> PointsT;
- typedef vector<uint64_t> DeltasT;
-
/// @name Encode and Decode function types.
//@{
- typedef void (*EncodeFunT)(PointsT const &, m2::PointU const &, m2::PointU const &, DeltasT &);
- typedef void (*DecodeFunT)(DeltasT const &, m2::PointU const &, m2::PointU const &, PointsT &);
+ typedef void (*EncodeFunT)( geo_coding::InPointsT const &,
+ m2::PointU const &, m2::PointU const &,
+ geo_coding::OutDeltasT &);
+ typedef void (*DecodeFunT)( geo_coding::InDeltasT const &,
+ m2::PointU const &, m2::PointU const &,
+ geo_coding::OutPointsT &);
//@}
+ typedef buffer_vector<uint64_t, 32> DeltasT;
+ typedef buffer_vector<m2::PointD, 32> OutPointsT;
+
void Encode(EncodeFunT fn, vector<m2::PointD> const & points, int64_t base, DeltasT & deltas);
- typedef buffer_vector<m2::PointD, 32> OutPointsT;
/// @name Overloads for different out container types.
//@{
void Decode(DecodeFunT fn, DeltasT const & deltas, int64_t base, OutPointsT & points, size_t reserveF = 1);
@@ -92,7 +95,7 @@ namespace serial
}
- /// @name Pathes.
+ /// @name Paths.
//@{
template <class TSink>
void SaveInnerPath(vector<m2::PointD> const & points, int64_t base, TSink & sink)
@@ -166,10 +169,10 @@ namespace serial
}
};
- void DecodeTriangles(DeltasT const & deltas,
+ void DecodeTriangles(geo_coding::InDeltasT const & deltas,
m2::PointU const & basePoint,
m2::PointU const & maxPoint,
- PointsT & triangles);
+ geo_coding::OutPointsT & triangles);
template <class TSource>
void LoadOuterTriangles(TSource & src, int64_t base, OutPointsT & triangles)