diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-06-11 14:48:47 +0300 |
---|---|---|
committer | Tatiana Yan <tatiana.kondakova@gmail.com> | 2019-06-13 16:15:51 +0300 |
commit | f1b3632042fe59b43fe45788bc62e662cdae1c1d (patch) | |
tree | 61d721eff261d5a051f202b6b2fbe3b28c4cf787 /storage | |
parent | 68c33fc33a63aedb11535918f7d109f3298d85fc (diff) |
[storage][promo] review fixes
Diffstat (limited to 'storage')
-rw-r--r-- | storage/country_tree.cpp | 24 | ||||
-rw-r--r-- | storage/country_tree.hpp | 4 | ||||
-rw-r--r-- | storage/storage.cpp | 4 | ||||
-rw-r--r-- | storage/storage.hpp | 4 | ||||
-rw-r--r-- | storage/storage_defines.hpp | 4 |
5 files changed, 20 insertions, 20 deletions
diff --git a/storage/country_tree.cpp b/storage/country_tree.cpp index 49769add01..58a329cba0 100644 --- a/storage/country_tree.cpp +++ b/storage/country_tree.cpp @@ -37,7 +37,7 @@ public: virtual void InsertOldMwmMapping(CountryId const & newId, CountryId const & oldId) = 0; virtual void InsertAffiliation(CountryId const & countryId, string const & affilation) = 0; virtual void InsertCountryNameSynonym(CountryId const & countryId, string const & synonym) = 0; - virtual void InsertPromoCatalogCity(CountryId const & countryId, uint64_t const & geoObjectId) {} + virtual void InsertMwmTopCityGeoId(CountryId const & countryId, uint64_t const & geoObjectId) {} virtual OldMwmMapping GetMapping() const = 0; }; @@ -46,17 +46,17 @@ class StoreCountriesSingleMwms : public StoreSingleMwmInterface CountryTree & m_countries; Affiliations & m_affiliations; CountryNameSynonyms & m_countryNameSynonyms; - PromoCatalogCities & m_promoCatalogCities; + MwmTopCityGeoIds & m_mwmTopCityGeoIds; OldMwmMapping m_idsMapping; public: StoreCountriesSingleMwms(CountryTree & countries, Affiliations & affiliations, CountryNameSynonyms & countryNameSynonyms, - PromoCatalogCities & promoCatalogCities) + MwmTopCityGeoIds & mwmTopCityGeoIds) : m_countries(countries) , m_affiliations(affiliations) , m_countryNameSynonyms(countryNameSynonyms) - , m_promoCatalogCities(promoCatalogCities) + , m_mwmTopCityGeoIds(mwmTopCityGeoIds) { } ~StoreCountriesSingleMwms() @@ -104,12 +104,12 @@ public: m_countryNameSynonyms[synonym] = countryId; } - void InsertPromoCatalogCity(CountryId const & countryId, uint64_t const & geoObjectId) override + void InsertMwmTopCityGeoId(CountryId const & countryId, uint64_t const & geoObjectId) override { ASSERT(!countryId.empty(), ()); ASSERT_NOT_EQUAL(geoObjectId, 0, ()); base::GeoObjectId id(geoObjectId); - m_promoCatalogCities.emplace(countryId, move(id)); + m_mwmTopCityGeoIds.emplace(countryId, move(id)); } OldMwmMapping GetMapping() const override { return m_idsMapping; } @@ -349,9 +349,9 @@ MwmSubtreeAttrs LoadGroupSingleMwmsImpl(size_t depth, json_t * node, CountryId c store.InsertAffiliation(id, affilationValue); uint64_t geoObjectId = 0; - FromJSONObjectOptionalField(node, "pc", geoObjectId); + FromJSONObjectOptionalField(node, "top_city_geo_id", geoObjectId); if (geoObjectId != 0) - store.InsertPromoCatalogCity(id, geoObjectId); + store.InsertMwmTopCityGeoId(id, geoObjectId); int nodeSize; FromJSONObjectOptionalField(node, "s", nodeSize); @@ -528,7 +528,7 @@ bool LoadCountriesTwoComponentMwmsImpl(string const & jsonBuffer, int64_t LoadCountriesFromBuffer(string const & jsonBuffer, CountryTree & countries, Affiliations & affiliations, CountryNameSynonyms & countryNameSynonyms, - PromoCatalogCities & promoCatalogCities, + MwmTopCityGeoIds & mwmTopCityGeoIds, OldMwmMapping * mapping /* = nullptr */) { countries.Clear(); @@ -543,7 +543,7 @@ int64_t LoadCountriesFromBuffer(string const & jsonBuffer, CountryTree & countri if (version::IsSingleMwm(version)) { StoreCountriesSingleMwms store(countries, affiliations, countryNameSynonyms, - promoCatalogCities); + mwmTopCityGeoIds); if (!LoadCountriesSingleMwmsImpl(jsonBuffer, store)) return -1; if (mapping) @@ -566,12 +566,12 @@ int64_t LoadCountriesFromBuffer(string const & jsonBuffer, CountryTree & countri int64_t LoadCountriesFromFile(string const & path, CountryTree & countries, Affiliations & affiliations, CountryNameSynonyms & countryNameSynonyms, - PromoCatalogCities & promoCatalogCities, OldMwmMapping * mapping) + MwmTopCityGeoIds & mwmTopCityGeoIds, OldMwmMapping * mapping) { string json; ReaderPtr<Reader>(GetPlatform().GetReader(path)).ReadAsString(json); return LoadCountriesFromBuffer(json, countries, affiliations, countryNameSynonyms, - promoCatalogCities, mapping); + mwmTopCityGeoIds, mapping); } void LoadCountryFile2CountryInfo(string const & jsonBuffer, map<string, CountryInfo> & id2info, diff --git a/storage/country_tree.hpp b/storage/country_tree.hpp index fbcca4a525..5a1c879ea6 100644 --- a/storage/country_tree.hpp +++ b/storage/country_tree.hpp @@ -119,12 +119,12 @@ private: int64_t LoadCountriesFromBuffer(std::string const & buffer, CountryTree & countries, Affiliations & affiliations, CountryNameSynonyms & countryNameSynonyms, - PromoCatalogCities & promoCatalogCities, + MwmTopCityGeoIds & mwmTopCityGeoIds, OldMwmMapping * mapping = nullptr); int64_t LoadCountriesFromFile(std::string const & path, CountryTree & countries, Affiliations & affiliations, CountryNameSynonyms & countryNameSynonyms, - PromoCatalogCities & promoCatalogCities, + MwmTopCityGeoIds & mwmTopCityGeoIds, OldMwmMapping * mapping = nullptr); void LoadCountryFile2CountryInfo(std::string const & jsonBuffer, diff --git a/storage/storage.cpp b/storage/storage.cpp index fcb2c7eb88..a688d3cef6 100644 --- a/storage/storage.cpp +++ b/storage/storage.cpp @@ -143,7 +143,7 @@ Storage::Storage(string const & referenceCountriesTxtJsonForTesting, { m_currentVersion = LoadCountriesFromBuffer(referenceCountriesTxtJsonForTesting, m_countries, m_affiliations, - m_countryNameSynonyms, m_promoCatalogCities); + m_countryNameSynonyms, m_mwmTopCityGeoIds); CHECK_LESS_OR_EQUAL(0, m_currentVersion, ("Can't load test countries file")); CalcMaxMwmSizeBytes(); } @@ -764,7 +764,7 @@ void Storage::LoadCountriesFile(string const & pathToCountriesFile, string const if (m_countries.IsEmpty()) { m_currentVersion = LoadCountriesFromFile(pathToCountriesFile, m_countries, m_affiliations, - m_countryNameSynonyms, m_promoCatalogCities, mapping); + m_countryNameSynonyms, m_mwmTopCityGeoIds, mapping); LOG_SHORT(LINFO, ("Loaded countries list for version:", m_currentVersion)); if (m_currentVersion < 0) LOG(LERROR, ("Can't load countries file", pathToCountriesFile)); diff --git a/storage/storage.hpp b/storage/storage.hpp index ecab27d3aa..853e0d9b4e 100644 --- a/storage/storage.hpp +++ b/storage/storage.hpp @@ -264,7 +264,7 @@ private: // Note. |m_affiliations| is empty in case of countries_obsolete.txt. Affiliations m_affiliations; CountryNameSynonyms m_countryNameSynonyms; - PromoCatalogCities m_promoCatalogCities; + MwmTopCityGeoIds m_mwmTopCityGeoIds; MwmSize m_maxMwmSizeBytes; @@ -473,7 +473,7 @@ public: CountryNameSynonyms const & GetCountryNameSynonyms() const { return m_countryNameSynonyms; } - PromoCatalogCities const & GetPromoCatalogCities() const { return m_promoCatalogCities; } + MwmTopCityGeoIds const & GetMwmTopCityGeoIds() const { return m_mwmTopCityGeoIds; } /// \brief Calls |toDo| for each node for subtree with |root|. /// For example ForEachInSubtree(GetRootId()) calls |toDo| for every node including diff --git a/storage/storage_defines.hpp b/storage/storage_defines.hpp index a93d7ab29b..6cde63257b 100644 --- a/storage/storage_defines.hpp +++ b/storage/storage_defines.hpp @@ -25,8 +25,8 @@ using OldMwmMapping = std::map<CountryId, CountriesSet>; using Affiliations = std::unordered_map<std::string, std::vector<CountryId>>; /// Map from country name synonyms and old names into CountryId. using CountryNameSynonyms = std::unordered_map<std::string, CountryId>; -/// Map from CountryId into promo catalog cities GeoObject id. -using PromoCatalogCities = std::unordered_map<CountryId, base::GeoObjectId>; +/// Map from CountryId into city GeoObject id. +using MwmTopCityGeoIds = std::unordered_map<CountryId, base::GeoObjectId>; extern const storage::CountryId kInvalidCountryId; |