diff --git a/search/reverse_geocoder.cpp b/search/reverse_geocoder.cpp index 392c7fe398..5cefc41890 100644 --- a/search/reverse_geocoder.cpp +++ b/search/reverse_geocoder.cpp @@ -13,8 +13,10 @@ #include "base/stl_helpers.hpp" -#include "std/function.hpp" -#include "std/limits.hpp" +#include +#include + +using namespace std; namespace search { diff --git a/search/reverse_geocoder.hpp b/search/reverse_geocoder.hpp index 9d0ac5a822..f293df6228 100644 --- a/search/reverse_geocoder.hpp +++ b/search/reverse_geocoder.hpp @@ -6,10 +6,12 @@ #include "base/string_utils.hpp" -#include "std/string.hpp" -#include "std/utility.hpp" -#include "std/vector.hpp" - +#include +#include +#include +#include +#include +#include class FeatureType; class DataSource; @@ -26,10 +28,10 @@ class ReverseGeocoder { FeatureID m_id; double m_distanceMeters; - string m_name; + std::string m_name; Object() : m_distanceMeters(-1.0) {} - Object(FeatureID const & id, double dist, string const & name) + Object(FeatureID const & id, double dist, std::string const & name) : m_id(id), m_distanceMeters(dist), m_name(name) { } @@ -37,7 +39,7 @@ class ReverseGeocoder inline bool IsValid() const { return m_id.IsValid(); } }; - friend string DebugPrint(Object const & obj); + friend std::string DebugPrint(Object const & obj); public: /// All "Nearby" functions work in this lookup radius. @@ -55,43 +57,44 @@ public: // There are no houses in (0, 0) coordinates. Building() : m_center(0, 0) {} - Building(FeatureID const & id, double dist, string const & number, m2::PointD const & center) + Building(FeatureID const & id, double dist, std::string const & number, + m2::PointD const & center) : Object(id, dist, number), m_center(center) { } }; static size_t GetMatchedStreetIndex(strings::UniString const & keyName, - vector const & streets); + std::vector const & streets); struct Address { Building m_building; Street m_street; - string const & GetHouseNumber() const { return m_building.m_name; } - string const & GetStreetName() const { return m_street.m_name; } + std::string const & GetHouseNumber() const { return m_building.m_name; } + std::string const & GetStreetName() const { return m_street.m_name; } double GetDistance() const { return m_building.m_distanceMeters; } bool IsValid() const { return m_building.IsValid() && m_street.IsValid(); } }; - friend string DebugPrint(Address const & addr); + friend std::string DebugPrint(Address const & addr); /// @return Sorted by distance streets vector for the specified MwmId. static void GetNearbyStreets(search::MwmContext & context, m2::PointD const & center, - vector & streets); + std::vector & streets); void GetNearbyStreets(MwmSet::MwmId const & id, m2::PointD const & center, - vector & streets) const; - void GetNearbyStreets(FeatureType & ft, vector & streets) const; + std::vector & streets) const; + void GetNearbyStreets(FeatureType & ft, std::vector & streets) const; void GetNearbyOriginalStreets(MwmSet::MwmId const & id, m2::PointD const & center, - vector & streets) const; + std::vector & streets) const; /// @returns [a lot of] nearby feature's streets and an index of a feature's street. /// Returns a value greater than vector size when there are no Street the feature belongs to. /// @note returned vector can contain duplicated street segments. - pair, uint32_t> GetNearbyFeatureStreets(FeatureType & ft) const; + std::pair, uint32_t> GetNearbyFeatureStreets(FeatureType & ft) const; /// Same as GetNearbyFeatureStreets but returns streets from MWM only. - pair, uint32_t> GetNearbyOriginalFeatureStreets(FeatureType & ft) const; + std::pair, uint32_t> GetNearbyOriginalFeatureStreets(FeatureType & ft) const; /// @return The nearest exact address where building has house number and valid street match. void GetNearbyAddress(m2::PointD const & center, Address & addr) const; @@ -107,19 +110,21 @@ private: /// Helper class to incapsulate house 2 street table reloading. class HouseTable { - DataSource const & m_dataSource; - unique_ptr m_table; - MwmSet::MwmHandle m_handle; public: explicit HouseTable(DataSource const & dataSource) : m_dataSource(dataSource) {} bool Get(FeatureID const & fid, uint32_t & streetIndex); + + private: + DataSource const & m_dataSource; + std::unique_ptr m_table; + MwmSet::MwmHandle m_handle; }; bool GetNearbyAddress(HouseTable & table, Building const & bld, Address & addr) const; /// @return Sorted by distance houses vector with valid house number. void GetNearbyBuildings(m2::PointD const & center, double maxDistanceM, - vector & buildings) const; + std::vector & buildings) const; static Building FromFeature(FeatureType & ft, double distMeters); };