diff options
author | Maxim Pimenov <m@maps.me> | 2019-02-12 19:13:51 +0300 |
---|---|---|
committer | Arsentiy Milchakov <milcars@mapswithme.com> | 2019-02-13 14:58:09 +0300 |
commit | b1bec1c75c8f6eaa0b16911833a92b2b9ce82ae3 (patch) | |
tree | b2e09955d50d2e97ffd215e086dd081586735dae /partners_api | |
parent | b4351494fbcafee4c421692bafc7c5d310bdab3d (diff) |
[storage] Removed the T prefix from type aliases and type names.
Diffstat (limited to 'partners_api')
-rw-r--r-- | partners_api/ads_base.cpp | 6 | ||||
-rw-r--r-- | partners_api/ads_base.hpp | 12 | ||||
-rw-r--r-- | partners_api/ads_engine.cpp | 4 | ||||
-rw-r--r-- | partners_api/ads_engine.hpp | 4 | ||||
-rw-r--r-- | partners_api/megafon_countries.cpp | 10 | ||||
-rw-r--r-- | partners_api/megafon_countries.hpp | 2 | ||||
-rw-r--r-- | partners_api/partners_api_tests/rutaxi_tests.cpp | 4 | ||||
-rw-r--r-- | partners_api/partners_api_tests/taxi_engine_tests.cpp | 28 | ||||
-rw-r--r-- | partners_api/rb_ads.cpp | 2 | ||||
-rw-r--r-- | partners_api/taxi_base.cpp | 8 | ||||
-rw-r--r-- | partners_api/taxi_base.hpp | 8 | ||||
-rw-r--r-- | partners_api/taxi_delegate.hpp | 4 | ||||
-rw-r--r-- | partners_api/taxi_places.cpp | 4 | ||||
-rw-r--r-- | partners_api/taxi_places.hpp | 8 |
14 files changed, 52 insertions, 52 deletions
diff --git a/partners_api/ads_base.cpp b/partners_api/ads_base.cpp index 32e6e57d0d..e646f2e2e3 100644 --- a/partners_api/ads_base.cpp +++ b/partners_api/ads_base.cpp @@ -35,7 +35,7 @@ void Container::AppendExcludedTypes( } void Container::AppendSupportedCountries( - std::initializer_list<storage::TCountryId> const & countries) + std::initializer_list<storage::CountryId> const & countries) { m_supportedCountries.insert(countries.begin(), countries.end()); } @@ -52,7 +52,7 @@ void Container::AppendSupportedUserLanguages(std::initializer_list<std::string> } bool Container::HasBanner(feature::TypesHolder const & types, - storage::TCountryId const & countryId, + storage::CountryId const & countryId, std::string const & userLanguage) const { if (!m_supportedCountries.empty() && @@ -66,7 +66,7 @@ bool Container::HasBanner(feature::TypesHolder const & types, } std::string Container::GetBannerId(feature::TypesHolder const & types, - storage::TCountryId const & countryId, + storage::CountryId const & countryId, std::string const & userLanguage) const { if (!HasBanner(types, countryId, userLanguage)) diff --git a/partners_api/ads_base.hpp b/partners_api/ads_base.hpp index 028827bd49..8af1491dd6 100644 --- a/partners_api/ads_base.hpp +++ b/partners_api/ads_base.hpp @@ -23,10 +23,10 @@ class ContainerBase public: virtual ~ContainerBase() = default; virtual bool HasBanner(feature::TypesHolder const & types, - storage::TCountryId const & countryId, + storage::CountryId const & countryId, std::string const & userLanguage) const = 0; virtual std::string GetBannerId(feature::TypesHolder const & types, - storage::TCountryId const & countryId, + storage::CountryId const & countryId, std::string const & userLanguage) const = 0; virtual std::string GetBannerIdForOtherTypes() const = 0; virtual bool HasSearchBanner() const = 0; @@ -41,10 +41,10 @@ public: // ContainerBase overrides: bool HasBanner(feature::TypesHolder const & types, - storage::TCountryId const & countryId, + storage::CountryId const & countryId, std::string const & userLanguage) const override; std::string GetBannerId(feature::TypesHolder const & types, - storage::TCountryId const & countryId, + storage::CountryId const & countryId, std::string const & userLanguage) const override; std::string GetBannerIdForOtherTypes() const override; bool HasSearchBanner() const override; @@ -54,14 +54,14 @@ protected: void AppendEntry(std::initializer_list<std::initializer_list<char const *>> && types, std::string const & id); void AppendExcludedTypes(std::initializer_list<std::initializer_list<char const *>> && types); - void AppendSupportedCountries(std::initializer_list<storage::TCountryId> const & countries); + void AppendSupportedCountries(std::initializer_list<storage::CountryId> const & countries); void AppendSupportedUserLanguages(std::initializer_list<std::string> const & languages); private: ftypes::HashMapMatcher<uint32_t, std::string> m_typesToBanners; ftypes::HashSetMatcher<uint32_t> m_excludedTypes; // All countries are supported when empty. - std::unordered_set<storage::TCountryId> m_supportedCountries; + std::unordered_set<storage::CountryId> m_supportedCountries; // It supplements |m_supportedCountries|. If a country isn't supported // we check user's language. std::unordered_set<int8_t> m_supportedUserLanguages; diff --git a/partners_api/ads_engine.cpp b/partners_api/ads_engine.cpp index eca7aac959..8d95345ccc 100644 --- a/partners_api/ads_engine.cpp +++ b/partners_api/ads_engine.cpp @@ -21,7 +21,7 @@ Engine::Engine() } bool Engine::HasBanner(feature::TypesHolder const & types, - storage::TCountriesVec const & countryIds, + storage::CountriesVec const & countryIds, std::string const & userLanguage) const { for (auto const & countryId : countryIds) @@ -37,7 +37,7 @@ bool Engine::HasBanner(feature::TypesHolder const & types, } std::vector<Banner> Engine::GetBanners(feature::TypesHolder const & types, - storage::TCountriesVec const & countryIds, + storage::CountriesVec const & countryIds, std::string const & userLanguage) const { std::vector<Banner> result; diff --git a/partners_api/ads_engine.hpp b/partners_api/ads_engine.hpp index cc4aa9d746..cc0f3d7541 100644 --- a/partners_api/ads_engine.hpp +++ b/partners_api/ads_engine.hpp @@ -20,10 +20,10 @@ public: Engine(); bool HasBanner(feature::TypesHolder const & types, - storage::TCountriesVec const & countryIds, + storage::CountriesVec const & countryIds, std::string const & userLanguage) const; std::vector<Banner> GetBanners(feature::TypesHolder const & types, - storage::TCountriesVec const & countryIds, + storage::CountriesVec const & countryIds, std::string const & userLanguage) const; void DisableAdProvider(Banner::Type const type, Banner::Place const place); bool HasSearchBanner() const; diff --git a/partners_api/megafon_countries.cpp b/partners_api/megafon_countries.cpp index 3f78c8a93b..e02d10f097 100644 --- a/partners_api/megafon_countries.cpp +++ b/partners_api/megafon_countries.cpp @@ -6,7 +6,7 @@ namespace ads { namespace { -storage::TCountriesVec const kCountries = { +storage::CountriesVec const kCountries = { "Armenia", "Austria", "Belarus", @@ -55,8 +55,8 @@ bool IsRussianLocale(std::string const & currentLocale) return currentLocale.find("ru") != std::string::npos; } -bool ContainsCountry(storage::Storage const & storage, storage::TCountriesVec const & countries, - storage::TCountriesVec const & referenceCountries) +bool ContainsCountry(storage::Storage const & storage, storage::CountriesVec const & countries, + storage::CountriesVec const & referenceCountries) { for (auto const & c : countries) { @@ -76,13 +76,13 @@ bool HasMegafonDownloaderBanner(storage::Storage const & storage, std::string co if (!IsRussianLocale(currentLocale)) return false; - storage::TCountriesVec countries; + storage::CountriesVec countries; storage.GetTopmostNodesFor(mwmId, countries); return ContainsCountry(storage, countries, kCountries); } bool HasMegafonCategoryBanner(storage::Storage const & storage, - storage::TCountriesVec const & countries, + storage::CountriesVec const & countries, std::string const & currentLocale) { if (!IsRussianLocale(currentLocale)) diff --git a/partners_api/megafon_countries.hpp b/partners_api/megafon_countries.hpp index 98fb7f530c..a5c2c6858f 100644 --- a/partners_api/megafon_countries.hpp +++ b/partners_api/megafon_countries.hpp @@ -9,7 +9,7 @@ namespace ads extern bool HasMegafonDownloaderBanner(storage::Storage const & storage, std::string const & mwmId, std::string const & currentLocale); extern bool HasMegafonCategoryBanner(storage::Storage const & storage, - storage::TCountriesVec const & countries, + storage::CountriesVec const & countries, std::string const & currentLocale); extern std::string GetMegafonDownloaderBannerUrl(); extern std::string GetMegafonCategoryBannerUrl(); diff --git a/partners_api/partners_api_tests/rutaxi_tests.cpp b/partners_api/partners_api_tests/rutaxi_tests.cpp index 1bce6e6f9b..1181e7a0a9 100644 --- a/partners_api/partners_api_tests/rutaxi_tests.cpp +++ b/partners_api/partners_api_tests/rutaxi_tests.cpp @@ -13,9 +13,9 @@ namespace class DelegateForTesting : public taxi::Delegate { public: - storage::TCountriesVec GetCountryIds(m2::PointD const & point) override { return {""}; } + storage::CountriesVec GetCountryIds(m2::PointD const & point) override { return {""}; } std::string GetCityName(m2::PointD const & point) override { return ""; } - storage::TCountryId GetMwmId(m2::PointD const & point) override { return ""; } + storage::CountryId GetMwmId(m2::PointD const & point) override { return ""; } }; using Runner = Platform::ThreadRunner; diff --git a/partners_api/partners_api_tests/taxi_engine_tests.cpp b/partners_api/partners_api_tests/taxi_engine_tests.cpp index 98e89d1d3b..a625dcbb5a 100644 --- a/partners_api/partners_api_tests/taxi_engine_tests.cpp +++ b/partners_api/partners_api_tests/taxi_engine_tests.cpp @@ -25,19 +25,19 @@ namespace class BelarusMinskDelegate : public taxi::Delegate { public: - storage::TCountriesVec GetCountryIds(m2::PointD const & point) override { return {"Belarus"}; } + storage::CountriesVec GetCountryIds(m2::PointD const & point) override { return {"Belarus"}; } std::string GetCityName(m2::PointD const & point) override { return "Minsk"; } - storage::TCountryId GetMwmId(m2::PointD const & point) override { return "Belarus_Minsk Region"; } + storage::CountryId GetMwmId(m2::PointD const & point) override { return "Belarus_Minsk Region"; } }; class UkraineOdessaDelegate : public taxi::Delegate { public: - storage::TCountriesVec GetCountryIds(m2::PointD const & point) override { return {"Ukraine"}; } + storage::CountriesVec GetCountryIds(m2::PointD const & point) override { return {"Ukraine"}; } std::string GetCityName(m2::PointD const & point) override { return "Odessa"; } - storage::TCountryId GetMwmId(m2::PointD const & point) override + storage::CountryId GetMwmId(m2::PointD const & point) override { return "Ukraine_Odessa Oblast"; } @@ -46,10 +46,10 @@ public: class UkraineMariupolDelegate : public taxi::Delegate { public: - storage::TCountriesVec GetCountryIds(m2::PointD const & point) override { return {"Ukraine"}; } + storage::CountriesVec GetCountryIds(m2::PointD const & point) override { return {"Ukraine"}; } std::string GetCityName(m2::PointD const & point) override { return "Mariupol"; } - storage::TCountryId GetMwmId(m2::PointD const & point) override + storage::CountryId GetMwmId(m2::PointD const & point) override { return "Ukraine_Donetsk Oblast"; } @@ -58,46 +58,46 @@ public: class BulgariaSofiaDelegate : public taxi::Delegate { public: - storage::TCountriesVec GetCountryIds(m2::PointD const & point) override { return {"Bulgaria"}; } + storage::CountriesVec GetCountryIds(m2::PointD const & point) override { return {"Bulgaria"}; } std::string GetCityName(m2::PointD const & point) override { return "Sofia"; } - storage::TCountryId GetMwmId(m2::PointD const & point) override { return {}; } + storage::CountryId GetMwmId(m2::PointD const & point) override { return {}; } }; class UsaDelegate : public taxi::Delegate { public: - storage::TCountriesVec GetCountryIds(m2::PointD const & point) override + storage::CountriesVec GetCountryIds(m2::PointD const & point) override { return {"United States of America"}; } std::string GetCityName(m2::PointD const & point) override { return {}; } - storage::TCountryId GetMwmId(m2::PointD const & point) override { return {}; } + storage::CountryId GetMwmId(m2::PointD const & point) override { return {}; } }; class RussiaKonetsDelegate : public taxi::Delegate { public: - storage::TCountriesVec GetCountryIds(m2::PointD const & point) override + storage::CountriesVec GetCountryIds(m2::PointD const & point) override { return {"Russian Federation"}; } std::string GetCityName(m2::PointD const & point) override { return "Konets"; } - storage::TCountryId GetMwmId(m2::PointD const & point) override { return {}; } + storage::CountryId GetMwmId(m2::PointD const & point) override { return {}; } }; class RussiaSochiDelegate : public taxi::Delegate { public: - storage::TCountriesVec GetCountryIds(m2::PointD const & point) override + storage::CountriesVec GetCountryIds(m2::PointD const & point) override { return {"Russian Federation"}; } std::string GetCityName(m2::PointD const & point) override { return "Sochi"; } - storage::TCountryId GetMwmId(m2::PointD const & point) override { return {}; } + storage::CountryId GetMwmId(m2::PointD const & point) override { return {}; } }; std::vector<taxi::Product> GetUberSynchronous(ms::LatLon const & from, ms::LatLon const & to, diff --git a/partners_api/rb_ads.cpp b/partners_api/rb_ads.cpp index 3052e20b48..f30ca5b2ff 100644 --- a/partners_api/rb_ads.cpp +++ b/partners_api/rb_ads.cpp @@ -14,7 +14,7 @@ auto const kEntertainmentPlacementId = "9"; auto const kBuildingPlacementId = "11"; auto const kBannerIdForOtherTypes = "14"; -std::initializer_list<storage::TCountryId> const kSupportedCountries = +std::initializer_list<storage::CountryId> const kSupportedCountries = { "Azerbaijan Region", "Armenia", diff --git a/partners_api/taxi_base.cpp b/partners_api/taxi_base.cpp index fd6cc9dfc4..ad9b5c6f4c 100644 --- a/partners_api/taxi_base.cpp +++ b/partners_api/taxi_base.cpp @@ -15,7 +15,7 @@ bool ApiBase::IsDistanceSupported(ms::LatLon const & from, ms::LatLon const & to return ms::DistanceOnEarth(from, to) <= kMaxSupportedDistance; } -bool ApiItem::AreAllCountriesDisabled(storage::TCountriesVec const & countryIds, +bool ApiItem::AreAllCountriesDisabled(storage::CountriesVec const & countryIds, std::string const & city) const { if (countryIds.empty()) @@ -33,7 +33,7 @@ bool ApiItem::AreAllCountriesDisabled(storage::TCountriesVec const & countryIds, return isCountryDisabled; } -bool ApiItem::IsAnyCountryEnabled(storage::TCountriesVec const & countryIds, +bool ApiItem::IsAnyCountryEnabled(storage::CountriesVec const & countryIds, std::string const & city) const { if (countryIds.empty()) @@ -53,7 +53,7 @@ bool ApiItem::IsAnyCountryEnabled(storage::TCountriesVec const & countryIds, return false; } -bool ApiItem::IsMwmDisabled(storage::TCountryId const & mwmId) const +bool ApiItem::IsMwmDisabled(storage::CountryId const & mwmId) const { auto const & disabled = m_places.m_disabledPlaces; if (mwmId.empty()) @@ -62,7 +62,7 @@ bool ApiItem::IsMwmDisabled(storage::TCountryId const & mwmId) const return disabled.Has(mwmId); } -bool ApiItem::IsMwmEnabled(storage::TCountryId const & mwmId) const +bool ApiItem::IsMwmEnabled(storage::CountryId const & mwmId) const { auto const & enabled = m_places.m_enabledPlaces; if (mwmId.empty()) diff --git a/partners_api/taxi_base.hpp b/partners_api/taxi_base.hpp index d4ca51890d..433eeab02a 100644 --- a/partners_api/taxi_base.hpp +++ b/partners_api/taxi_base.hpp @@ -61,12 +61,12 @@ struct ApiItem { } - bool AreAllCountriesDisabled(storage::TCountriesVec const & countryIds, + bool AreAllCountriesDisabled(storage::CountriesVec const & countryIds, std::string const & city) const; - bool IsAnyCountryEnabled(storage::TCountriesVec const & countryIds, + bool IsAnyCountryEnabled(storage::CountriesVec const & countryIds, std::string const & city) const; - bool IsMwmDisabled(storage::TCountryId const & mwmId) const; - bool IsMwmEnabled(storage::TCountryId const & mwmId) const; + bool IsMwmDisabled(storage::CountryId const & mwmId) const; + bool IsMwmEnabled(storage::CountryId const & mwmId) const; Provider::Type m_type; ApiPtr m_api; diff --git a/partners_api/taxi_delegate.hpp b/partners_api/taxi_delegate.hpp index f8f4d4eeb8..6ceb68d77a 100644 --- a/partners_api/taxi_delegate.hpp +++ b/partners_api/taxi_delegate.hpp @@ -13,8 +13,8 @@ class Delegate public: virtual ~Delegate() = default; - virtual storage::TCountriesVec GetCountryIds(m2::PointD const & point) = 0; + virtual storage::CountriesVec GetCountryIds(m2::PointD const & point) = 0; virtual std::string GetCityName(m2::PointD const & point) = 0; - virtual storage::TCountryId GetMwmId(m2::PointD const & point) = 0; + virtual storage::CountryId GetMwmId(m2::PointD const & point) = 0; }; } // namespace taxi diff --git a/partners_api/taxi_places.cpp b/partners_api/taxi_places.cpp index 03fb5e6156..2114f5b4c7 100644 --- a/partners_api/taxi_places.cpp +++ b/partners_api/taxi_places.cpp @@ -7,7 +7,7 @@ namespace taxi bool Places::IsCountriesEmpty() const { return m_countries.empty(); } bool Places::IsMwmsEmpty() const { return m_mwmIds.empty(); } -bool Places::Has(storage::TCountryId const & id, std::string const & city) const +bool Places::Has(storage::CountryId const & id, std::string const & city) const { auto const countryIt = std::find_if(m_countries.cbegin(), m_countries.cend(), @@ -27,7 +27,7 @@ bool Places::Has(storage::TCountryId const & id, std::string const & city) const return cityIt != cities.cend(); } -bool Places::Has(storage::TCountryId const & mwmId) const +bool Places::Has(storage::CountryId const & mwmId) const { return m_mwmIds.find(mwmId) != m_mwmIds.cend(); } diff --git a/partners_api/taxi_places.hpp b/partners_api/taxi_places.hpp index da019e17e7..5b2503047c 100644 --- a/partners_api/taxi_places.hpp +++ b/partners_api/taxi_places.hpp @@ -19,7 +19,7 @@ public: struct Country { - storage::TCountryId m_id; + storage::CountryId m_id; std::vector<std::string> m_cities; DECLARE_VISITOR_AND_DEBUG_PRINT(Country, visitor(m_id, "id"), visitor(m_cities, "cities")) @@ -27,15 +27,15 @@ public: bool IsCountriesEmpty() const; bool IsMwmsEmpty() const; - bool Has(storage::TCountryId const & id, std::string const & city) const; - bool Has(storage::TCountryId const & mwmId) const; + bool Has(storage::CountryId const & id, std::string const & city) const; + bool Has(storage::CountryId const & mwmId) const; DECLARE_VISITOR_AND_DEBUG_PRINT(Places, visitor(m_countries, "countries"), visitor(m_mwmIds, "mwms")) private: std::vector<Country> m_countries; - std::unordered_set<storage::TCountryId> m_mwmIds; + std::unordered_set<storage::CountryId> m_mwmIds; }; struct SupportedPlaces |