From f0a748ebb69a4e7cc9e24888ba5edb580126c034 Mon Sep 17 00:00:00 2001 From: vng Date: Wed, 3 Sep 2014 12:40:06 +0300 Subject: [PATCH] Made FeatureParams::GetTypeMask private. --- generator/feature_builder.cpp | 10 +++++----- generator/feature_builder.hpp | 12 ++++++------ indexer/feature_data.hpp | 3 ++- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/generator/feature_builder.cpp b/generator/feature_builder.cpp index 9099d846d2..ee7b7348cd 100644 --- a/generator/feature_builder.cpp +++ b/generator/feature_builder.cpp @@ -528,15 +528,15 @@ void FeatureBuilder2::Serialize(buffers_holder_t & data, serial::CodingParams co BitSink< PushBackByteSink > bitSink(sink); - uint8_t const h = m_params.GetTypeMask(); + EGeomType const type = m_params.GetGeomType(); - if (h == HEADER_GEOM_LINE) + if (type == GEOM_LINE) { bitSink.Write(ptsCount, 4); if (ptsCount == 0) bitSink.Write(data.m_ptsMask, 4); } - else if (h == HEADER_GEOM_AREA) + else if (type == GEOM_AREA) { bitSink.Write(trgCount, 4); if (trgCount == 0) @@ -545,7 +545,7 @@ void FeatureBuilder2::Serialize(buffers_holder_t & data, serial::CodingParams co bitSink.Finish(); - if (h == HEADER_GEOM_LINE) + if (type == GEOM_LINE) { if (ptsCount > 0) { @@ -574,7 +574,7 @@ void FeatureBuilder2::Serialize(buffers_holder_t & data, serial::CodingParams co serial::WriteVarUintArray(data.m_ptsOffset, sink); } } - else if (h == HEADER_GEOM_AREA) + else if (type == GEOM_AREA) { if (trgCount > 0) serial::SaveInnerTriangles(data.m_innerTrg, params, sink); diff --git a/generator/feature_builder.hpp b/generator/feature_builder.hpp index 54ddb6fdbb..f71e30b1ae 100644 --- a/generator/feature_builder.hpp +++ b/generator/feature_builder.hpp @@ -30,8 +30,8 @@ public: void AddPoint(m2::PointD const & p); /// Set that feature is linear type. - void SetLinear() { m_params.SetGeomType(feature::GEOM_LINE); } - void SetArea() { m_params.SetGeomType(feature::GEOM_AREA); } + inline void SetLinear() { m_params.SetGeomType(feature::GEOM_LINE); } + inline void SetArea() { m_params.SetGeomType(feature::GEOM_AREA); } /// Set that feature is area and get ownership of holes. void SetAreaAddHoles(list > const & holes); @@ -218,12 +218,12 @@ public: buffers_holder_t() : m_ptsMask(0), m_trgMask(0), m_ptsSimpMask(0) {} }; - bool IsLine() const { return (m_params.GetTypeMask() == feature::HEADER_GEOM_LINE); } - bool IsArea() const { return (m_params.GetTypeMask() == feature::HEADER_GEOM_AREA); } + inline bool IsLine() const { return (GetGeomType() == feature::GEOM_LINE); } + inline bool IsArea() const { return (GetGeomType() == feature::GEOM_AREA); } bool IsDrawableInRange(int lowS, int highS) const; - points_t const & GetOuterPoly() const { return GetGeometry(); } - list const & GetPolygons() const { return m_polygons; } + inline points_t const & GetOuterPoly() const { return GetGeometry(); } + inline list const & GetPolygons() const { return m_polygons; } /// @name Overwrite from base_type. //@{ diff --git a/indexer/feature_data.hpp b/indexer/feature_data.hpp index 2d1d0f09a3..032805a0df 100644 --- a/indexer/feature_data.hpp +++ b/indexer/feature_data.hpp @@ -244,7 +244,6 @@ public: void SetGeomType(feature::EGeomType t); void SetGeomTypePointEx(); feature::EGeomType GetGeomType() const; - uint8_t GetTypeMask() const; inline void AddType(uint32_t t) { m_Types.push_back(t); } @@ -297,6 +296,8 @@ public: } private: + uint8_t GetTypeMask() const; + static uint32_t GetIndexForType(uint32_t t); static uint32_t GetTypeForIndex(uint32_t i); };