From 53051b62cdeee34ed919265b0cb8b2ca9042cd19 Mon Sep 17 00:00:00 2001 From: Yury Melnichek Date: Tue, 31 May 2011 10:14:09 +0200 Subject: [PATCH] Rename types in feature_visibility according to our style. --- generator/osm_element.hpp | 8 +++---- indexer/classificator.hpp | 2 +- indexer/feature_visibility.cpp | 44 +++++++++++++++++----------------- indexer/feature_visibility.hpp | 4 ++-- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/generator/osm_element.hpp b/generator/osm_element.hpp index 0d89d357a3..eb0a05c823 100644 --- a/generator/osm_element.hpp +++ b/generator/osm_element.hpp @@ -448,7 +448,7 @@ protected: if (p->name == "node") { - if (!feature::IsDrawableLike(fValue.m_Types, feature::fpoint)) + if (!feature::IsDrawableLike(fValue.m_Types, feature::FEATURE_TYPE_POINT)) return; m2::PointD pt; @@ -464,8 +464,8 @@ protected: // __debugbreak(); //#endif - bool const isLine = feature::IsDrawableLike(fValue.m_Types, feature::fline); - bool const isArea = feature::IsDrawableLike(fValue.m_Types, feature::farea); + bool const isLine = feature::IsDrawableLike(fValue.m_Types, feature::FEATURE_TYPE_LINE); + bool const isArea = feature::IsDrawableLike(fValue.m_Types, feature::FEATURE_TYPE_AREA); if (!isLine && !isArea) return; @@ -506,7 +506,7 @@ protected: // __debugbreak(); //#endif - if (!feature::IsDrawableLike(fValue.m_Types, feature::farea)) + if (!feature::IsDrawableLike(fValue.m_Types, feature::FEATURE_TYPE_AREA)) return; // check, if this is our processable relation diff --git a/indexer/classificator.hpp b/indexer/classificator.hpp index 6e43ce5be0..eaa9ba8d1d 100644 --- a/indexer/classificator.hpp +++ b/indexer/classificator.hpp @@ -233,7 +233,7 @@ public: public: /// @name Used only in feature_visibility.cpp, not for public use. //@{ - template typename ToDo::result_type + template typename ToDo::ResultType ProcessObjects(uint32_t type, ToDo & toDo) const; ClassifObject const * GetObject(uint32_t type) const; diff --git a/indexer/feature_visibility.cpp b/indexer/feature_visibility.cpp index 2a949d13fb..5f8ac3bfe4 100644 --- a/indexer/feature_visibility.cpp +++ b/indexer/feature_visibility.cpp @@ -13,7 +13,7 @@ namespace { - bool need_process_parent(ClassifObject const * p) + bool NeedProcessParent(ClassifObject const * p) { string const & n = p->GetName(); // same as is_mark_key (@see osm2type.cpp) @@ -21,11 +21,11 @@ namespace } } -template typename ToDo::result_type +template typename ToDo::ResultType Classificator::ProcessObjects(uint32_t type, ToDo & toDo) const { - typedef typename ToDo::result_type res_t; - res_t res = res_t(); // default initialization + typedef typename ToDo::ResultType ResultType; + ResultType res = ResultType(); // default initialization ClassifObject const * p = &m_root; uint8_t i = 0; @@ -53,7 +53,7 @@ Classificator::ProcessObjects(uint32_t type, ToDo & toDo) const if (toDo(path[i-1], res)) break; // no need to process parents - if (!need_process_parent(path[i-1])) break; + if (!NeedProcessParent(path[i-1])) break; } return res; } @@ -98,7 +98,7 @@ namespace feature namespace { - class get_draw_rule + class DrawRuleGetter { int m_scale; ClassifObject::feature_t m_ft; @@ -106,13 +106,13 @@ namespace string & m_name; public: - get_draw_rule(int scale, feature::EGeomType ft, + DrawRuleGetter(int scale, feature::EGeomType ft, vector & keys, string & name) : m_scale(scale), m_ft(ClassifObject::feature_t(ft)), m_keys(keys), m_name(name) { } - typedef bool result_type; + typedef bool ResultType; void operator() (ClassifObject const * p) { @@ -140,7 +140,7 @@ int GetDrawRule(FeatureBase const & f, int level, vector & keys, str ASSERT ( keys.empty(), () ); Classificator const & c = classif(); - get_draw_rule doRules(level, geoType, keys, names); + DrawRuleGetter doRules(level, geoType, keys, names); for (int i = 0; i < types.m_size; ++i) (void)c.ProcessObjects(types.m_types[i], doRules); @@ -149,14 +149,14 @@ int GetDrawRule(FeatureBase const & f, int level, vector & keys, str namespace { - class check_is_drawable + class IsDrawableChecker { int m_scale; public: - check_is_drawable(int scale) : m_scale(scale) {} + IsDrawableChecker(int scale) : m_scale(scale) {} - typedef bool result_type; + typedef bool ResultType; void operator() (ClassifObject const *) {} bool operator() (ClassifObject const * p, bool & res) @@ -170,17 +170,17 @@ namespace } }; - class check_is_drawable_like + class IsDrawableLikeChecker { ClassifObject::feature_t m_type; public: - check_is_drawable_like(feature_geo_t type) + IsDrawableLikeChecker(FeatureGeoType type) : m_type(ClassifObject::feature_t(type)) { } - typedef bool result_type; + typedef bool ResultType; void operator() (ClassifObject const *) {} bool operator() (ClassifObject const * p, bool & res) @@ -194,18 +194,18 @@ namespace } }; - class check_text_rules + class TextRulesChecker { int m_scale; ClassifObject::feature_t m_ft; public: - check_text_rules(int scale, feature::EGeomType ft) + TextRulesChecker(int scale, feature::EGeomType ft) : m_scale(scale), m_ft(ClassifObject::feature_t(ft)) { } - typedef bool result_type; + typedef bool ResultType; void operator() (ClassifObject const *) {} bool operator() (ClassifObject const * p, bool & res) @@ -230,11 +230,11 @@ bool IsDrawableAny(uint32_t type) return classif().GetObject(type)->IsDrawableAny(); } -bool IsDrawableLike(vector const & types, feature_geo_t ft) +bool IsDrawableLike(vector const & types, FeatureGeoType ft) { Classificator const & c = classif(); - check_is_drawable_like doCheck(ft); + IsDrawableLikeChecker doCheck(ft); for (size_t i = 0; i < types.size(); ++i) if (c.ProcessObjects(types[i], doCheck)) return true; @@ -252,7 +252,7 @@ bool IsDrawableForIndex(FeatureBase const & f, int level) Classificator const & c = classif(); - check_is_drawable doCheck(level); + IsDrawableChecker doCheck(level); for (int i = 0; i < types.m_size; ++i) if (c.ProcessObjects(types.m_types[i], doCheck)) return true; @@ -282,7 +282,7 @@ int MinDrawableScaleForText(FeatureBase const & f) int const upBound = scales::GetUpperScale(); for (int level = 0; level <= upBound; ++level) { - check_text_rules doCheck(level, geomType); + TextRulesChecker doCheck(level, geomType); for (int i = 0; i < types.m_size; ++i) if (c.ProcessObjects(types.m_types[i], doCheck)) return level; diff --git a/indexer/feature_visibility.hpp b/indexer/feature_visibility.hpp index 6a15ed1fc3..37349c3f31 100644 --- a/indexer/feature_visibility.hpp +++ b/indexer/feature_visibility.hpp @@ -11,10 +11,10 @@ class FeatureBase; namespace feature { - enum feature_geo_t { fpoint = 0, fline, farea }; + enum FeatureGeoType { FEATURE_TYPE_POINT = 0, FEATURE_TYPE_LINE, FEATURE_TYPE_AREA }; bool IsDrawableAny(uint32_t type); - bool IsDrawableLike(vector const & type, feature_geo_t ft); + bool IsDrawableLike(vector const & type, FeatureGeoType ft); bool IsDrawableForIndex(FeatureBase const & f, int level); int MinDrawableScaleForFeature(FeatureBase const & f);