diff options
author | vng <viktor.govako@gmail.com> | 2012-01-27 14:34:49 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:32:30 +0300 |
commit | f87031f54b1e60a7310efb5c2608fad6b62c27c8 (patch) | |
tree | 84434d4331ffbbc0427bc4cdfffe736cc9766e05 /indexer/feature_data.hpp | |
parent | dba450bed7a835b786a6a31690045ace01cbd275 (diff) |
Factor out #include "classificator.hpp" from "feature_data.hpp".
Diffstat (limited to 'indexer/feature_data.hpp')
-rw-r--r-- | indexer/feature_data.hpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/indexer/feature_data.hpp b/indexer/feature_data.hpp index a892d027c8..1b57d9b117 100644 --- a/indexer/feature_data.hpp +++ b/indexer/feature_data.hpp @@ -1,5 +1,4 @@ #pragma once -#include "classificator.hpp" #include "../coding/multilang_utf8_string.hpp" #include "../coding/value_opt_string.hpp" @@ -182,10 +181,8 @@ public: WriteToSink(sink, header); - Classificator & c = classif(); - for (size_t i = 0; i < m_Types.size(); ++i) - WriteVarUint(sink, c.GetIndexForType(m_Types[i])); + WriteVarUint(sink, GetIndexForType(m_Types[i])); BaseT::Write(sink, header, GetGeomType()); } @@ -201,14 +198,16 @@ public: if (type & HEADER_GEOM_AREA) SetGeomType(GEOM_AREA); if (type == HEADER_GEOM_POINT) SetGeomType(GEOM_POINT); - Classificator & c = classif(); - size_t const count = (header & HEADER_TYPE_MASK) + 1; for (size_t i = 0; i < count; ++i) - m_Types.push_back(c.GetTypeForIndex(ReadVarUint<uint32_t>(src))); + m_Types.push_back(GetTypeForIndex(ReadVarUint<uint32_t>(src))); BaseT::Read(src, header, GetGeomType()); } + +private: + static uint32_t GetIndexForType(uint32_t t); + static uint32_t GetTypeForIndex(uint32_t i); }; string DebugPrint(FeatureParams const & p); |