[map] Moved FeaturesFetcher out of namespace model (thus removing this namespace).

Alternatives considered were:
  namespace feature
  namespace map
  namespace utils
This commit is contained in:
Maxim Pimenov 2019-09-16 15:05:27 +03:00 committed by Tatiana Yan
parent 6e8da26d67
commit 8fe8dbe568
31 changed files with 216 additions and 237 deletions

View file

@ -203,7 +203,7 @@ private:
EWidget m_currentElement = WIDGET_RULER;
ResolverParser m_parser;
map<EWidget, pair<PositionResolver, PositionResolver> > & m_skin;
std::map<EWidget, pair<PositionResolver, PositionResolver>> & m_skin;
};
}

View file

@ -26,6 +26,7 @@
#include "defines.hpp"
#include <map>
#include <string>
using namespace feature;
@ -69,7 +70,7 @@ TPoint3DList const kRoad4 = {{-10, 1, -1}, {-20, 6, -100}, {-20, -11, -110}};
class MockAltitudeGetter : public AltitudeGetter
{
public:
using TMockAltitudes = map<m2::PointI, TAltitude>;
using TMockAltitudes = std::map<m2::PointI, TAltitude>;
explicit MockAltitudeGetter(vector<TPoint3DList> const & roads)
{

View file

@ -3,7 +3,7 @@
#import "SwiftBridge.h"
#import "UIImageView+Coloring.h"
#include "std/map.hpp"
#include <map>
namespace
{
@ -32,8 +32,8 @@ CGFloat angleWithProgress(CGFloat progress) { return 2.0 * M_PI * progress - M_P
@implementation MWMCircularProgressView
{
map<MWMCircularProgressState, MWMButtonColoring> m_buttonColoring;
map<MWMCircularProgressState, NSString *> m_images;
std::map<MWMCircularProgressState, MWMButtonColoring> m_buttonColoring;
std::map<MWMCircularProgressState, NSString *> m_images;
}
- (void)awakeFromNib

View file

@ -28,7 +28,7 @@ CGFloat const kShiftedTurnsTopOffset = 8;
NSTimeInterval constexpr kCollapseSearchTimeout = 5.0;
map<NavigationSearchState, NSString *> const kSearchStateButtonImageNames{
std::map<NavigationSearchState, NSString *> const kSearchStateButtonImageNames{
{NavigationSearchState::Maximized, @"ic_routing_search"},
{NavigationSearchState::MinimizedNormal, @"ic_routing_search"},
{NavigationSearchState::MinimizedSearch, @"ic_routing_search_off"},
@ -38,7 +38,7 @@ map<NavigationSearchState, NSString *> const kSearchStateButtonImageNames{
{NavigationSearchState::MinimizedFood, @"ic_routing_food_off"},
{NavigationSearchState::MinimizedATM, @"ic_routing_atm_off"}};
map<NavigationSearchState, NSString *> const kSearchButtonRequest{
std::map<NavigationSearchState, NSString *> const kSearchButtonRequest{
{NavigationSearchState::MinimizedGas, L(@"fuel")},
{NavigationSearchState::MinimizedParking, L(@"parking")},
{NavigationSearchState::MinimizedEat, L(@"eat")},

View file

@ -33,7 +33,7 @@ static CGFloat const kDrivingOptionsHeight = 48;
@implementation MWMRoutePreview
{
map<MWMRouterType, MWMCircularProgress *> m_progresses;
std::map<MWMRouterType, MWMCircularProgress *> m_progresses;
}
- (void)awakeFromNib

View file

@ -85,7 +85,7 @@ struct GeoModeSettings
DesiredAccuracy accuracy;
};
map<GeoMode, GeoModeSettings> const kGeoSettings{
std::map<GeoMode, GeoModeSettings> const kGeoSettings{
{GeoMode::Pending,
{.distanceFilter = kCLDistanceFilterNone,
.accuracy = {.charging = kCLLocationAccuracyBestForNavigation,

View file

@ -61,7 +61,7 @@ vector<MWMEditorCellType> const kSectionAddressCellTypes{
vector<MWMEditorCellType> const kSectionNoteCellTypes{MWMEditorCellTypeNote};
vector<MWMEditorCellType> const kSectionButtonCellTypes{MWMEditorCellTypeReportButton};
using MWMEditorCellTypeClassMap = map<MWMEditorCellType, Class>;
using MWMEditorCellTypeClassMap = std::map<MWMEditorCellType, Class>;
MWMEditorCellTypeClassMap const kCellType2Class{
{MWMEditorCellTypeCategory, [MWMEditorCategoryCell class]},
{MWMEditorCellTypeAdditionalName, [MWMEditorAdditionalNameTableViewCell class]},
@ -182,7 +182,7 @@ void registerCellsForTableView(vector<MWMEditorCellType> const & cells, UITableV
@implementation MWMEditorViewController
{
vector<MWMEditorSection> m_sections;
map<MWMEditorSection, vector<MWMEditorCellType>> m_cells;
std::map<MWMEditorSection, vector<MWMEditorCellType>> m_cells;
osm::EditableMapObject m_mapObject;
vector<NSInteger> m_newAdditionalLanguages;
}

View file

@ -28,7 +28,7 @@ namespace
{
using place_page::MetainfoRows;
map<MetainfoRows, Class> const kMetaInfoCells = {
std::map<MetainfoRows, Class> const kMetaInfoCells = {
{MetainfoRows::Website, [MWMPlacePageLinkCell class]},
{MetainfoRows::Address, [MWMPlacePageInfoCell class]},
{MetainfoRows::Email, [MWMPlacePageLinkCell class]},

View file

@ -35,7 +35,7 @@ void setPushWooshSender()
void setMarketingSender()
{
GetPlatform().GetMarketingService().SetMarketingSender([](string const & tag, map<string, string> const & params)
GetPlatform().GetMarketingService().SetMarketingSender([](string const & tag, std::map<string, string> const & params)
{
if (tag.empty())
return;

View file

@ -55,7 +55,7 @@ namespace
}
};
void RunBenchmark(model::FeaturesFetcher const & src, m2::RectD const & rect,
void RunBenchmark(FeaturesFetcher const & src, m2::RectD const & rect,
pair<int, int> const & scaleRange, AllResult & res)
{
ASSERT_LESS_OR_EQUAL(scaleRange.first, scaleRange.second, ());
@ -103,7 +103,7 @@ void RunFeaturesLoadingBenchmark(string const & file, pair<int, int> scaleRange,
platform::LocalCountryFile localFile =
platform::LocalCountryFile::MakeForTesting(fileName);
model::FeaturesFetcher src;
FeaturesFetcher src;
auto const r = src.RegisterMap(localFile);
if (r.second != MwmSet::RegResult::Success)
return;

View file

@ -2,29 +2,18 @@
#include "platform/platform.hpp"
#include "indexer/cell_coverer.hpp"
#include "indexer/scales.hpp"
#include "indexer/classificator_loader.hpp"
#include "indexer/scales.hpp"
#include "base/assert.hpp"
#include "base/logging.hpp"
#include "std/bind.hpp"
using platform::CountryFile;
using platform::LocalCountryFile;
namespace model
{
FeaturesFetcher::FeaturesFetcher()
{
m_dataSource.AddObserver(*this);
}
FeaturesFetcher::FeaturesFetcher() { m_dataSource.AddObserver(*this); }
FeaturesFetcher::~FeaturesFetcher()
{
m_dataSource.RemoveObserver(*this);
}
FeaturesFetcher::~FeaturesFetcher() { m_dataSource.RemoveObserver(*this); }
// While reading any files (classificator or mwm), there are 2 types of possible exceptions:
// Reader::Exception, FileAbsentException.
@ -76,23 +65,7 @@ bool FeaturesFetcher::DeregisterMap(CountryFile const & countryFile)
void FeaturesFetcher::Clear() { m_dataSource.Clear(); }
void FeaturesFetcher::ClearCaches()
{
m_dataSource.ClearCache();
}
void FeaturesFetcher::OnMapUpdated(platform::LocalCountryFile const & newFile,
platform::LocalCountryFile const & oldFile)
{
if (m_onMapDeregistered)
m_onMapDeregistered(oldFile);
}
void FeaturesFetcher::OnMapDeregistered(platform::LocalCountryFile const & localFile)
{
if (m_onMapDeregistered)
m_onMapDeregistered(localFile);
}
void FeaturesFetcher::ClearCaches() { m_dataSource.ClearCache(); }
m2::RectD FeaturesFetcher::GetWorldRect() const
{
@ -105,4 +78,17 @@ m2::RectD FeaturesFetcher::GetWorldRect() const
return m_rect;
}
void FeaturesFetcher::OnMapUpdated(platform::LocalCountryFile const & newFile,
platform::LocalCountryFile const & oldFile)
{
if (m_onMapDeregistered)
m_onMapDeregistered(oldFile);
}
void FeaturesFetcher::OnMapDeregistered(platform::LocalCountryFile const & localFile)
{
if (m_onMapDeregistered)
{
m_onMapDeregistered(localFile);
}
}

View file

@ -5,11 +5,11 @@
#include "indexer/data_header.hpp"
#include "indexer/mwm_set.hpp"
#include "geometry/rect2d.hpp"
#include "geometry/point2d.hpp"
#include "geometry/rect2d.hpp"
#include "coding/reader.hpp"
#include "coding/buffer_reader.hpp"
#include "coding/reader.hpp"
#include "base/macros.hpp"
@ -17,86 +17,71 @@
#include <string>
#include <utility>
namespace model
{
//#define USE_BUFFER_READER
class FeaturesFetcher : public MwmSet::Observer
{
public:
using Reader = ModelReaderPtr;
using MapDeregisteredCallback = std::function<void(platform::LocalCountryFile const &)>;
FeaturesFetcher();
virtual ~FeaturesFetcher();
void InitClassificator();
void SetOnMapDeregisteredCallback(MapDeregisteredCallback const & callback)
{
public:
#ifdef USE_BUFFER_READER
using Reader = BufferReader;
#else
using Reader = ModelReaderPtr;
#endif
m_onMapDeregistered = callback;
}
using MapDeregisteredCallback = std::function<void(platform::LocalCountryFile const &)>;
// Registers a new map.
std::pair<MwmSet::MwmId, MwmSet::RegResult> RegisterMap(
platform::LocalCountryFile const & localFile);
private:
m2::RectD m_rect;
// Deregisters a map denoted by file from internal records.
bool DeregisterMap(platform::CountryFile const & countryFile);
EditableDataSource m_dataSource;
void Clear();
MapDeregisteredCallback m_onMapDeregistered;
void ClearCaches();
public:
FeaturesFetcher();
bool IsLoaded(std::string const & countryFileName) const
{
return m_dataSource.IsLoaded(platform::CountryFile(countryFileName));
}
virtual ~FeaturesFetcher();
void ForEachFeature(m2::RectD const & rect, std::function<void(FeatureType &)> const & fn,
int scale) const
{
m_dataSource.ForEachInRect(fn, rect, scale);
}
void InitClassificator();
inline void SetOnMapDeregisteredCallback(MapDeregisteredCallback const & callback)
{
m_onMapDeregistered = callback;
}
/// Registers a new map.
std::pair<MwmSet::MwmId, MwmSet::RegResult> RegisterMap(
platform::LocalCountryFile const & localFile);
/// Deregisters a map denoted by file from internal records.
bool DeregisterMap(platform::CountryFile const & countryFile);
void Clear();
void ClearCaches();
inline bool IsLoaded(string const & countryFileName) const
{
return m_dataSource.IsLoaded(platform::CountryFile(countryFileName));
}
// MwmSet::Observer overrides:
void OnMapUpdated(platform::LocalCountryFile const & newFile,
platform::LocalCountryFile const & oldFile) override;
void OnMapDeregistered(platform::LocalCountryFile const & localFile) override;
//bool IsLoaded(m2::PointD const & pt) const;
/// @name Features enumeration.
//@{
void ForEachFeature(m2::RectD const & rect, std::function<void(FeatureType &)> const & fn,
void ForEachFeatureID(m2::RectD const & rect, std::function<void(FeatureID const &)> const & fn,
int scale) const
{
m_dataSource.ForEachInRect(fn, rect, scale);
}
{
m_dataSource.ForEachFeatureIDInRect(fn, rect, scale);
}
void ForEachFeatureID(m2::RectD const & rect, std::function<void(FeatureID const &)> const & fn,
int scale) const
{
m_dataSource.ForEachFeatureIDInRect(fn, rect, scale);
}
template <class ToDo>
void ReadFeatures(ToDo & toDo, vector<FeatureID> const & features) const
{
m_dataSource.ReadFeatures(toDo, features);
}
template <class ToDo>
void ReadFeatures(ToDo & toDo, vector<FeatureID> const & features) const
{
m_dataSource.ReadFeatures(toDo, features);
}
//@}
DataSource const & GetDataSource() const { return m_dataSource; }
DataSource & GetDataSource() { return m_dataSource; }
m2::RectD GetWorldRect() const;
DataSource const & GetDataSource() const { return m_dataSource; }
DataSource & GetDataSource() { return m_dataSource; }
m2::RectD GetWorldRect() const;
};
}
// MwmSet::Observer overrides:
void OnMapUpdated(platform::LocalCountryFile const & newFile,
platform::LocalCountryFile const & oldFile) override;
void OnMapDeregistered(platform::LocalCountryFile const & localFile) override;
private:
m2::RectD m_rect;
EditableDataSource m_dataSource;
MapDeregisteredCallback m_onMapDeregistered;
};

View file

@ -17,9 +17,6 @@
#include "generator/borders.hpp"
#include "defines.hpp"
#include "private.h"
#include "routing/city_roads.hpp"
#include "routing/index_router.hpp"
#include "routing/online_absent_fetcher.hpp"
@ -108,17 +105,20 @@
#include "std/algorithm.hpp"
#include "std/bind.hpp"
#include "std/map.hpp"
#include "std/sstream.hpp"
#include "std/target_os.hpp"
#include "api/internal/c/api-client-internals.h"
#include "api/src/c/api-client.h"
#include "3party/Alohalytics/src/alohalytics.h"
#include <map>
#include <memory>
#include "defines.hpp"
#include "private.h"
#include "3party/Alohalytics/src/alohalytics.h"
using namespace storage;
using namespace routing;
using namespace location;
@ -232,7 +232,7 @@ pair<MwmSet::MwmId, MwmSet::RegResult> Framework::RegisterMap(
LocalCountryFile const & localFile)
{
LOG(LINFO, ("Loading map:", localFile.GetCountryName()));
return m_model.RegisterMap(localFile);
return m_featuresFetcher.RegisterMap(localFile);
}
void Framework::OnLocationError(TLocationError /*error*/)
@ -391,7 +391,7 @@ void Framework::Migrate(bool keepDownloaded)
CountriesVec existedCountries;
GetStorage().DeleteAllLocalMaps(&existedCountries);
DeregisterAllMaps();
m_model.Clear();
m_featuresFetcher.Clear();
GetStorage().Migrate(keepDownloaded ? existedCountries : CountriesVec());
InitCountryInfoGetter();
InitSearchAPI();
@ -400,11 +400,11 @@ void Framework::Migrate(bool keepDownloaded)
InitTaxiEngine();
RegisterAllMaps();
m_notificationManager.SetDelegate(
std::make_unique<NotificationManagerDelegate>(m_model.GetDataSource(), *m_cityFinder,
std::make_unique<NotificationManagerDelegate>(m_featuresFetcher.GetDataSource(), *m_cityFinder,
m_addressGetter, *m_ugcApi));
m_trafficManager.SetCurrentDataVersion(GetStorage().GetCurrentDataVersion());
m_bmManager->InitRegionAddressGetter(m_model.GetDataSource(), *m_infoGetter);
m_bmManager->InitRegionAddressGetter(m_featuresFetcher.GetDataSource(), *m_infoGetter);
if (m_drapeEngine && m_isRenderingEnabled)
{
m_drapeEngine->SetRenderingEnabled();
@ -423,14 +423,14 @@ Framework::Framework(FrameworkParams const & params)
, m_storage(platform::migrate::NeedMigrate() ? COUNTRIES_OBSOLETE_FILE : COUNTRIES_FILE)
, m_enabledDiffs(params.m_enableDiffs)
, m_isRenderingEnabled(true)
, m_transitManager(m_model.GetDataSource(),
, m_transitManager(m_featuresFetcher.GetDataSource(),
[this](FeatureCallback const & fn, vector<FeatureID> const & features) {
return m_model.ReadFeatures(fn, features);
return m_featuresFetcher.ReadFeatures(fn, features);
},
bind(&Framework::GetMwmsByRect, this, _1, false /* rough */))
, m_routingManager(
RoutingManager::Callbacks(
[this]() -> DataSource & { return m_model.GetDataSource(); },
[this]() -> DataSource & { return m_featuresFetcher.GetDataSource(); },
[this]() -> storage::CountryInfoGetter & { return GetCountryInfoGetter(); },
[this](string const & id) -> string { return m_storage.GetParentIdFor(id); },
[this]() -> StringsBundle const & { return m_stringsBundle; },
@ -438,15 +438,15 @@ Framework::Framework(FrameworkParams const & params)
static_cast<RoutingManager::Delegate &>(*this))
, m_trafficManager(bind(&Framework::GetMwmsByRect, this, _1, false /* rough */),
kMaxTrafficCacheSizeBytes, m_routingManager.RoutingSession())
, m_bookingFilterProcessor(m_model.GetDataSource(), *m_bookingApi)
, m_bookingFilterProcessor(m_featuresFetcher.GetDataSource(), *m_bookingApi)
, m_displacementModeManager([this](bool show) {
int const mode = show ? dp::displacement::kHotelMode : dp::displacement::kDefaultMode;
if (m_drapeEngine != nullptr)
m_drapeEngine->SetDisplacementMode(mode);
})
, m_lastReportedCountry(kInvalidCountryId)
, m_popularityLoader(m_model.GetDataSource(), POPULARITY_RANKS_FILE_TAG)
, m_descriptionsLoader(std::make_unique<descriptions::Loader>(m_model.GetDataSource()))
, m_popularityLoader(m_featuresFetcher.GetDataSource(), POPULARITY_RANKS_FILE_TAG)
, m_descriptionsLoader(std::make_unique<descriptions::Loader>(m_featuresFetcher.GetDataSource()))
, m_purchase(std::make_unique<Purchase>([this] { m_user.ResetAccessToken(); }))
, m_tipsApi(static_cast<TipsApi::Delegate &>(*this))
{
@ -478,8 +478,8 @@ Framework::Framework(FrameworkParams const & params)
// Wi-Fi string is used in categories that's why does not have core_ prefix
m_stringsBundle.SetDefaultString("wifi", "WiFi");
m_model.InitClassificator();
m_model.SetOnMapDeregisteredCallback(bind(&Framework::OnMapDeregistered, this, _1));
m_featuresFetcher.InitClassificator();
m_featuresFetcher.SetOnMapDeregisteredCallback(bind(&Framework::OnMapDeregistered, this, _1));
LOG(LDEBUG, ("Classificator initialized"));
m_displayedCategories = make_unique<search::DisplayedCategories>(GetDefaultCategories());
@ -503,7 +503,7 @@ Framework::Framework(FrameworkParams const & params)
[this](vector<BookmarkGroupInfo> const & marks) { GetSearchAPI().OnBookmarksAttached(marks); },
[this](vector<BookmarkGroupInfo> const & marks) { GetSearchAPI().OnBookmarksDetached(marks); }));
m_bmManager->InitRegionAddressGetter(m_model.GetDataSource(), *m_infoGetter);
m_bmManager->InitRegionAddressGetter(m_featuresFetcher.GetDataSource(), *m_infoGetter);
m_ParsedMapApi.SetBookmarkManager(m_bmManager.get());
m_routingManager.SetBookmarkManager(m_bmManager.get());
@ -516,7 +516,7 @@ Framework::Framework(FrameworkParams const & params)
{
auto const userPos = GetCurrentPosition();
if (userPos)
OnRouteStartBuild(m_model.GetDataSource(), points, userPos.get());
OnRouteStartBuild(m_featuresFetcher.GetDataSource(), points, userPos.get());
});
InitCityFinder();
@ -556,11 +556,11 @@ Framework::Framework(FrameworkParams const & params)
LOG(LINFO, ("System languages:", languages::GetPreferred()));
editor.SetDelegate(make_unique<search::EditorDelegate>(m_model.GetDataSource()));
editor.SetDelegate(make_unique<search::EditorDelegate>(m_featuresFetcher.GetDataSource()));
editor.SetInvalidateFn([this](){ InvalidateRect(GetCurrentViewport()); });
editor.LoadEdits();
m_model.GetDataSource().AddObserver(editor);
m_featuresFetcher.GetDataSource().AddObserver(editor);
LOG(LINFO, ("Editor initialized"));
@ -574,7 +574,7 @@ Framework::Framework(FrameworkParams const & params)
LOG(LDEBUG, ("Transliterators initialized"));
m_notificationManager.SetDelegate(
std::make_unique<NotificationManagerDelegate>(m_model.GetDataSource(), *m_cityFinder,
std::make_unique<NotificationManagerDelegate>(m_featuresFetcher.GetDataSource(), *m_cityFinder,
m_addressGetter, *m_ugcApi));
m_notificationManager.Load();
m_notificationManager.TrimExpired();
@ -588,7 +588,7 @@ Framework::Framework(FrameworkParams const & params)
GetPowerManager().Subscribe(this);
GetPowerManager().Load();
m_promoApi->SetDelegate(make_unique<PromoDelegate>(m_model.GetDataSource(), *m_cityFinder));
m_promoApi->SetDelegate(make_unique<PromoDelegate>(m_featuresFetcher.GetDataSource(), *m_cityFinder));
eye::Eye::Instance().Subscribe(m_promoApi.get());
}
@ -611,7 +611,7 @@ Framework::~Framework()
GetBookmarkManager().Teardown();
m_trafficManager.Teardown();
DestroyDrapeEngine();
m_model.SetOnMapDeregisteredCallback(nullptr);
m_featuresFetcher.SetOnMapDeregisteredCallback(nullptr);
m_user.ClearSubscribers();
// Must be destroyed implicitly, since it stores reference to m_user.
@ -681,7 +681,7 @@ void Framework::OnCountryFileDownloaded(storage::CountryId const & countryId,
if (localFile && HasOptions(localFile->GetFiles(), MapOptions::Map))
{
// Add downloaded map.
auto p = m_model.RegisterMap(*localFile);
auto p = m_featuresFetcher.RegisterMap(*localFile);
MwmSet::MwmId const & id = p.first;
if (id.IsAlive())
rect = id.GetInfo()->m_bordersRect;
@ -710,7 +710,7 @@ bool Framework::OnCountryFileDelete(storage::CountryId const & countryId,
if (localFile)
{
rect = m_infoGetter->GetLimitRectForLeaf(countryId);
m_model.DeregisterMap(platform::CountryFile(countryId));
m_featuresFetcher.DeregisterMap(platform::CountryFile(countryId));
deferredDelete = true;
}
InvalidateRect(rect);
@ -747,7 +747,7 @@ bool Framework::HasUnsavedEdits(storage::CountryId const & countryId)
if (groupNode)
return;
hasUnsavedChanges |= osm::Editor::Instance().HaveMapEditsToUpload(
m_model.GetDataSource().GetMwmIdByCountryFile(platform::CountryFile(fileName)));
m_featuresFetcher.GetDataSource().GetMwmIdByCountryFile(platform::CountryFile(fileName)));
};
GetStorage().ForEachInSubtree(countryId, forEachInSubtree);
return hasUnsavedChanges;
@ -815,7 +815,7 @@ void Framework::RegisterAllMaps()
void Framework::DeregisterAllMaps()
{
m_model.Clear();
m_featuresFetcher.Clear();
m_storage.Clear();
}
@ -863,7 +863,7 @@ void Framework::ResetBookmarkInfo(Bookmark const & bmk, place_page::Info & info)
search::ReverseGeocoder::Address Framework::GetAddressAtPoint(m2::PointD const & pt) const
{
return m_addressGetter.GetAddressAtPoint(m_model.GetDataSource(), pt);
return m_addressGetter.GetAddressAtPoint(m_featuresFetcher.GetDataSource(), pt);
}
void Framework::FillFeatureInfo(FeatureID const & fid, place_page::Info & info) const
@ -874,7 +874,7 @@ void Framework::FillFeatureInfo(FeatureID const & fid, place_page::Info & info)
return;
}
FeaturesLoaderGuard const guard(m_model.GetDataSource(), fid.m_mwmId);
FeaturesLoaderGuard const guard(m_featuresFetcher.GetDataSource(), fid.m_mwmId);
auto ft = guard.GetFeatureByIndex(fid.m_index);
if (!ft)
{
@ -893,7 +893,7 @@ void Framework::FillPointInfo(place_page::Info & info, m2::PointD const & mercat
if (fid.IsValid())
{
m_model.GetDataSource().ReadFeature(
m_featuresFetcher.GetDataSource().ReadFeature(
[&](FeatureType & ft) { FillInfoFromFeatureType(ft, info); }, fid);
}
else
@ -1107,7 +1107,7 @@ void Framework::FillRoadTypeMarkInfo(RoadWarningMark const & roadTypeMark, place
{
if (roadTypeMark.GetFeatureID().IsValid())
{
FeaturesLoaderGuard const guard(m_model.GetDataSource(), roadTypeMark.GetFeatureID().m_mwmId);
FeaturesLoaderGuard const guard(m_featuresFetcher.GetDataSource(), roadTypeMark.GetFeatureID().m_mwmId);
auto ft = guard.GetFeatureByIndex(roadTypeMark.GetFeatureID().m_index);
if (ft)
{
@ -1252,7 +1252,7 @@ void Framework::ShowAll()
{
if (m_drapeEngine == nullptr)
return;
m_drapeEngine->SetModelViewAnyRect(m2::AnyRectD(m_model.GetWorldRect()), false /* isAnim */,
m_drapeEngine->SetModelViewAnyRect(m2::AnyRectD(m_featuresFetcher.GetWorldRect()), false /* isAnim */,
false /* useVisibleViewport */);
}
@ -1415,12 +1415,12 @@ bool Framework::IsCountryLoaded(m2::PointD const & pt) const
if (fName.empty())
return true;
return m_model.IsLoaded(fName);
return m_featuresFetcher.IsLoaded(fName);
}
bool Framework::IsCountryLoadedByName(string const & name) const
{
return m_model.IsLoaded(name);
return m_featuresFetcher.IsLoaded(name);
}
void Framework::InvalidateRect(m2::RectD const & rect)
@ -1431,7 +1431,7 @@ void Framework::InvalidateRect(m2::RectD const & rect)
void Framework::ClearAllCaches()
{
m_model.ClearCaches();
m_featuresFetcher.ClearCaches();
m_infoGetter->ClearCaches();
GetSearchAPI().ClearCaches();
}
@ -1554,7 +1554,7 @@ void Framework::InitUGC()
{
ASSERT(!m_ugcApi.get(), ("InitUGC() must be called only once."));
m_ugcApi = make_unique<ugc::Api>(m_model.GetDataSource(), [this](size_t numberOfUnsynchronized) {
m_ugcApi = make_unique<ugc::Api>(m_featuresFetcher.GetDataSource(), [this](size_t numberOfUnsynchronized) {
if (numberOfUnsynchronized == 0)
return;
@ -1580,7 +1580,7 @@ void Framework::InitSearchAPI()
try
{
m_searchAPI =
make_unique<SearchAPI>(m_model.GetDataSource(), m_storage, *m_infoGetter,
make_unique<SearchAPI>(m_featuresFetcher.GetDataSource(), m_storage, *m_infoGetter,
static_cast<SearchAPI::Delegate &>(*this));
}
catch (RootException const & e)
@ -1595,7 +1595,7 @@ void Framework::InitDiscoveryManager()
CHECK(m_cityFinder.get(), ("InitDiscoveryManager() must be called after InitCityFinder()"));
discovery::Manager::APIs const apis(*m_searchAPI, *m_promoApi, *m_localsApi);
m_discoveryManager = make_unique<discovery::Manager>(m_model.GetDataSource(), apis);
m_discoveryManager = make_unique<discovery::Manager>(m_featuresFetcher.GetDataSource(), apis);
}
void Framework::InitTransliteration()
@ -1892,12 +1892,12 @@ void Framework::CreateDrapeEngine(ref_ptr<dp::GraphicsContextFactory> contextFac
{
auto idReadFn = [this](df::MapDataProvider::TReadCallback<FeatureID const> const & fn,
m2::RectD const & r,
int scale) -> void { m_model.ForEachFeatureID(r, fn, scale); };
int scale) -> void { m_featuresFetcher.ForEachFeatureID(r, fn, scale); };
auto featureReadFn = [this](df::MapDataProvider::TReadCallback<FeatureType> const & fn,
vector<FeatureID> const & ids) -> void
{
m_model.ReadFeatures(fn, ids);
m_featuresFetcher.ReadFeatures(fn, ids);
};
auto myPositionModeChangedFn = [this](location::EMyPositionMode mode, bool routingActive)
@ -2330,7 +2330,7 @@ FeatureID Framework::GetFeatureAtPoint(m2::PointD const & mercator,
auto haveBuilding = false;
auto closestDistanceToCenter = numeric_limits<double>::max();
auto currentDistance = numeric_limits<double>::max();
indexer::ForEachFeatureAtPoint(m_model.GetDataSource(), [&](FeatureType & ft)
indexer::ForEachFeatureAtPoint(m_featuresFetcher.GetDataSource(), [&](FeatureType & ft)
{
if (fullMatch.IsValid())
return;
@ -2378,7 +2378,7 @@ osm::MapObject Framework::GetMapObjectByID(FeatureID const & fid) const
{
osm::MapObject res;
ASSERT(fid.IsValid(), ());
FeaturesLoaderGuard guard(m_model.GetDataSource(), fid.m_mwmId);
FeaturesLoaderGuard guard(m_featuresFetcher.GetDataSource(), fid.m_mwmId);
auto ft = guard.GetFeatureByIndex(fid.m_index);
if (ft)
res.SetFromFeatureType(*ft);
@ -2577,7 +2577,7 @@ FeatureID Framework::FindBuildingAtPoint(m2::PointD const & mercator) const
constexpr int kScale = scales::GetUpperScale();
constexpr double kSelectRectWidthInMeters = 1.1;
m2::RectD const rect = MercatorBounds::RectByCenterXYAndSizeInMeters(mercator, kSelectRectWidthInMeters);
m_model.ForEachFeature(rect, [&](FeatureType & ft)
m_featuresFetcher.ForEachFeature(rect, [&](FeatureType & ft)
{
if (!featureId.IsValid() &&
ft.GetGeomType() == feature::GeomType::Area &&
@ -2948,7 +2948,7 @@ vector<m2::TriangleD> Framework::GetSelectedFeatureTriangles() const
if (!m_selectedFeature.IsValid())
return triangles;
FeaturesLoaderGuard const guard(m_model.GetDataSource(), m_selectedFeature.m_mwmId);
FeaturesLoaderGuard const guard(m_featuresFetcher.GetDataSource(), m_selectedFeature.m_mwmId);
auto ft = guard.GetFeatureByIndex(m_selectedFeature.m_index);
if (!ft)
return triangles;
@ -3092,7 +3092,7 @@ bool Framework::ParseEditorDebugCommand(search::SearchParams const & params)
{
FeatureID const & fid = edit.first;
FeaturesLoaderGuard guard(m_model.GetDataSource(), fid.m_mwmId);
FeaturesLoaderGuard guard(m_featuresFetcher.GetDataSource(), fid.m_mwmId);
auto ft = guard.GetFeatureByIndex(fid.m_index);
if (!ft)
{
@ -3133,7 +3133,7 @@ bool Framework::ParseEditorDebugCommand(search::SearchParams const & params)
auto const features = FindFeaturesByIndex(index);
for (auto const & fid : features)
{
FeaturesLoaderGuard guard(m_model.GetDataSource(), fid.m_mwmId);
FeaturesLoaderGuard guard(m_featuresFetcher.GetDataSource(), fid.m_mwmId);
auto ft = guard.GetFeatureByIndex(fid.m_index);
if (!ft)
continue;
@ -3298,7 +3298,7 @@ bool Framework::CreateMapObject(m2::PointD const & mercator, uint32_t const feat
osm::EditableMapObject & emo) const
{
emo = {};
auto const & dataSource = m_model.GetDataSource();
auto const & dataSource = m_featuresFetcher.GetDataSource();
MwmSet::MwmId const mwmId = dataSource.GetMwmIdByCountryFile(
platform::CountryFile(m_infoGetter->GetRegionCountryId(mercator)));
if (!mwmId.IsAlive())
@ -3306,11 +3306,11 @@ bool Framework::CreateMapObject(m2::PointD const & mercator, uint32_t const feat
GetPlatform().GetMarketingService().SendMarketingEvent(marketing::kEditorAddStart, {});
search::ReverseGeocoder const coder(m_model.GetDataSource());
search::ReverseGeocoder const coder(m_featuresFetcher.GetDataSource());
vector<search::ReverseGeocoder::Street> streets;
coder.GetNearbyStreets(mwmId, mercator, streets);
emo.SetNearbyStreets(TakeSomeStreetsAndLocalize(streets, m_model.GetDataSource()));
emo.SetNearbyStreets(TakeSomeStreetsAndLocalize(streets, m_featuresFetcher.GetDataSource()));
// TODO(mgsergio): Check emo is a poi. For now it is the only option.
SetHostingBuildingAddress(FindBuildingAtPoint(mercator), dataSource, coder, emo);
@ -3323,7 +3323,7 @@ bool Framework::GetEditableMapObject(FeatureID const & fid, osm::EditableMapObje
if (!fid.IsValid())
return false;
FeaturesLoaderGuard guard(m_model.GetDataSource(), fid.m_mwmId);
FeaturesLoaderGuard guard(m_featuresFetcher.GetDataSource(), fid.m_mwmId);
auto ft = guard.GetFeatureByIndex(fid.m_index);
if (!ft)
return false;
@ -3335,7 +3335,7 @@ bool Framework::GetEditableMapObject(FeatureID const & fid, osm::EditableMapObje
auto const & editor = osm::Editor::Instance();
emo.SetEditableProperties(editor.GetEditableProperties(*ft));
auto const & dataSource = m_model.GetDataSource();
auto const & dataSource = m_featuresFetcher.GetDataSource();
search::ReverseGeocoder const coder(dataSource);
SetStreet(coder, dataSource, *ft, emo);
@ -3366,7 +3366,7 @@ osm::Editor::SaveResult Framework::SaveEditedMapObject(osm::EditableMapObject em
{
auto const isCreatedFeature = editor.IsCreatedFeature(emo.GetID());
FeaturesLoaderGuard g(m_model.GetDataSource(), emo.GetID().m_mwmId);
FeaturesLoaderGuard g(m_featuresFetcher.GetDataSource(), emo.GetID().m_mwmId);
std::unique_ptr<FeatureType> originalFeature;
if (!isCreatedFeature)
{
@ -3395,7 +3395,7 @@ osm::Editor::SaveResult Framework::SaveEditedMapObject(osm::EditableMapObject em
issueLatLon = MercatorBounds::ToLatLon(feature::GetCenter(*hostingBuildingFeature));
search::ReverseGeocoder::Address hostingBuildingAddress;
search::ReverseGeocoder const coder(m_model.GetDataSource());
search::ReverseGeocoder const coder(m_featuresFetcher.GetDataSource());
// The is no address to take from a hosting building. Fallback to simple saving.
if (!coder.GetExactAddress(*hostingBuildingFeature, hostingBuildingAddress))
break;
@ -3615,7 +3615,7 @@ std::vector<std::string> Framework::GetRegionsCountryIdByRect(m2::RectD const &
void Framework::VisualizeRoadsInRect(m2::RectD const & rect)
{
m_model.ForEachFeature(rect, [this, &rect](FeatureType & ft)
m_featuresFetcher.ForEachFeature(rect, [this, &rect](FeatureType & ft)
{
if (routing::IsRoad(feature::TypesHolder(ft)))
VisualizeFeatureInRect(rect, ft, m_drapeApi);
@ -3662,7 +3662,7 @@ void Framework::VisualizeCityBoundariesInRect(m2::RectD const & rect)
void Framework::VisualizeCityRoadsInRect(m2::RectD const & rect)
{
map<MwmSet::MwmId, unique_ptr<CityRoads>> cityRoads;
std::map<MwmSet::MwmId, unique_ptr<CityRoads>> cityRoads;
GetDataSource().ForEachInRect(
[this, &rect, &cityRoads](FeatureType & ft) {
if (ft.GetGeomType() != feature::GeomType::Line)
@ -3672,7 +3672,7 @@ void Framework::VisualizeCityRoadsInRect(m2::RectD const & rect)
auto const it = cityRoads.find(mwmId);
if (it == cityRoads.cend())
{
MwmSet::MwmHandle handle = m_model.GetDataSource().GetMwmHandleById(mwmId);
MwmSet::MwmHandle handle = m_featuresFetcher.GetDataSource().GetMwmHandleById(mwmId);
if (!handle.IsAlive())
return;
@ -3819,7 +3819,7 @@ vector<MwmSet::MwmId> Framework::GetMwmsByRect(m2::RectD const & rect, bool roug
MwmSet::MwmId Framework::GetMwmIdByName(string const & name) const
{
return m_model.GetDataSource().GetMwmIdByCountryFile(platform::CountryFile(name));
return m_featuresFetcher.GetDataSource().GetMwmIdByCountryFile(platform::CountryFile(name));
}
vector<FeatureID> Framework::FindFeaturesByIndex(uint32_t featureIndex) const
@ -3842,7 +3842,7 @@ vector<FeatureID> Framework::FindFeaturesByIndex(uint32_t featureIndex) const
for (auto const & mwmId : mwms)
{
FeaturesLoaderGuard const guard(m_model.GetDataSource(), mwmId);
FeaturesLoaderGuard const guard(m_featuresFetcher.GetDataSource(), mwmId);
if (featureIndex < guard.GetNumFeatures() && guard.GetFeatureByIndex(featureIndex))
result.emplace_back(mwmId, featureIndex);
}
@ -3852,7 +3852,7 @@ vector<FeatureID> Framework::FindFeaturesByIndex(uint32_t featureIndex) const
void Framework::ReadFeatures(function<void(FeatureType &)> const & reader,
vector<FeatureID> const & features)
{
m_model.ReadFeatures(reader, features);
m_featuresFetcher.ReadFeatures(reader, features);
}
// RoutingManager::Delegate
@ -3888,7 +3888,7 @@ void Framework::InitCityFinder()
{
ASSERT(!m_cityFinder, ());
m_cityFinder = make_unique<search::CityFinder>(m_model.GetDataSource());
m_cityFinder = make_unique<search::CityFinder>(m_featuresFetcher.GetDataSource());
}
void Framework::InitTaxiEngine()
@ -4135,11 +4135,11 @@ TipsApi const & Framework::GetTipsApi() const
bool Framework::HaveTransit(m2::PointD const & pt) const
{
auto const & dataSource = m_model.GetDataSource();
auto const & dataSource = m_featuresFetcher.GetDataSource();
MwmSet::MwmId const mwmId =
dataSource.GetMwmIdByCountryFile(platform::CountryFile(m_infoGetter->GetRegionCountryId(pt)));
MwmSet::MwmHandle handle = m_model.GetDataSource().GetMwmHandleById(mwmId);
MwmSet::MwmHandle handle = m_featuresFetcher.GetDataSource().GetMwmHandleById(mwmId);
if (!handle.IsAlive())
return false;
@ -4160,19 +4160,19 @@ bool Framework::MakePlacePageInfo(NotificationCandidate const & notification,
m2::RectD rect = MercatorBounds::RectByCenterXYAndOffset(notification.GetPos(), kMwmPointAccuracy);
bool found = false;
m_model.GetDataSource().ForEachInRect([this, &info, &notification, &found](FeatureType & ft)
{
if (found || !feature::GetCenter(ft).EqualDxDy(notification.GetPos(), kMwmPointAccuracy))
return;
m_featuresFetcher.GetDataSource().ForEachInRect(
[this, &info, &notification, &found](FeatureType & ft) {
if (found || !feature::GetCenter(ft).EqualDxDy(notification.GetPos(), kMwmPointAccuracy))
return;
auto const foundMapObject = utils::MakeEyeMapObject(ft);
if (!foundMapObject.IsEmpty() && notification.IsSameMapObject(foundMapObject))
{
FillInfoFromFeatureType(ft, info);
found = true;
}
},
rect, scales::GetUpperScale());
auto const foundMapObject = utils::MakeEyeMapObject(ft);
if (!foundMapObject.IsEmpty() && notification.IsSameMapObject(foundMapObject))
{
FillInfoFromFeatureType(ft, info);
found = true;
}
},
rect, scales::GetUpperScale());
return found;
}

View file

@ -13,8 +13,8 @@
#include "map/mwm_url.hpp"
#include "map/notifications/notification_manager.hpp"
#include "map/place_page_info.hpp"
#include "map/power_management/power_manager.hpp"
#include "map/power_management/power_management_schemas.hpp"
#include "map/power_management/power_manager.hpp"
#include "map/purchase.hpp"
#include "map/routing_manager.hpp"
#include "map/routing_mark.hpp"
@ -187,14 +187,14 @@ protected:
StringsBundle m_stringsBundle;
model::FeaturesFetcher m_model;
FeaturesFetcher m_featuresFetcher;
// The order matters here: DisplayedCategories may be used only
// after classificator is loaded by |m_model|.
// after classificator is loaded by |m_featuresFetcher|.
unique_ptr<search::DisplayedCategories> m_displayedCategories;
// The order matters here: storage::CountryInfoGetter and
// m_model::FeaturesFetcher must be initialized before
// m_FeaturesFetcher must be initialized before
// search::Engine and, therefore, destroyed after search::Engine.
unique_ptr<storage::CountryInfoGetter> m_infoGetter;
@ -262,7 +262,7 @@ protected:
bool OnCountryFileDelete(storage::CountryId const & countryId,
storage::LocalFilePtr const localFile);
/// This function is called by m_model when the map file is deregistered.
/// This function is called by m_featuresFetcher when the map file is deregistered.
void OnMapDeregistered(platform::LocalCountryFile const & localFile);
void ClearAllCaches();
@ -346,7 +346,7 @@ public:
storage::CountryInfoGetter & GetCountryInfoGetter() { return *m_infoGetter; }
StorageDownloadingPolicy & GetDownloadingPolicy() { return m_storageDownloadingPolicy; }
DataSource const & GetDataSource() const { return m_model.GetDataSource(); }
DataSource const & GetDataSource() const { return m_featuresFetcher.GetDataSource(); }
SearchAPI & GetSearchAPI();
SearchAPI const & GetSearchAPI() const;
@ -762,7 +762,7 @@ public:
template <typename TFn>
void ForEachFeatureAtPoint(TFn && fn, m2::PointD const & mercator) const
{
indexer::ForEachFeatureAtPoint(m_model.GetDataSource(), fn, mercator, 0.0);
indexer::ForEachFeatureAtPoint(m_featuresFetcher.GetDataSource(), fn, mercator, 0.0);
}
osm::MapObject GetMapObjectByID(FeatureID const & fid) const;

View file

@ -27,7 +27,7 @@ UNIT_TEST(CheckMWM_LoadAll)
platform::FindAllLocalMapsInDirectoryAndCleanup(platform.WritableDir(), 0 /* version */,
-1 /* latestVersion */, localFiles);
model::FeaturesFetcher m;
FeaturesFetcher m;
m.InitClassificator();
for (platform::LocalCountryFile const & localFile : localFiles)

View file

@ -4,11 +4,12 @@
#include "base/logging.hpp"
#include "std/map.hpp"
#include <map>
using namespace std;
namespace
{
location::GpsTrackInfo MakeGpsTrackInfo(double timestamp, ms::LatLon const & ll, double speed)
{
location::GpsTrackInfo info;
@ -18,7 +19,6 @@ location::GpsTrackInfo MakeGpsTrackInfo(double timestamp, ms::LatLon const & ll,
info.m_longitude = ll.m_lon;
return info;
}
} // namespace
UNIT_TEST(GpsTrackCollection_Simple)

View file

@ -16,7 +16,7 @@ using namespace std;
namespace
{
typedef model::FeaturesFetcher SourceT;
using SourceT = FeaturesFetcher;
class FeaturesLoader : public threads::IRoutine
{

View file

@ -249,7 +249,7 @@ public:
// void RunTest(string const & countryFileName)
// {
// model::FeaturesFetcher src1;
// FeaturesFetcher src1;
// src1.InitClassificator();
// platform::LocalCountryFile localFile(platform::LocalCountryFile::MakeForTesting(countryFileName));

View file

@ -38,7 +38,7 @@ public:
bool RunTest(string const & countryFileName, int lowS, int highS)
{
model::FeaturesFetcher src;
FeaturesFetcher src;
auto p = src.RegisterMap(platform::LocalCountryFile::MakeForTesting(countryFileName));
if (p.second != MwmSet::RegResult::Success)
return false;

View file

@ -19,13 +19,14 @@
#include "std/atomic.hpp"
#include "std/chrono.hpp"
#include "std/condition_variable.hpp"
#include "std/map.hpp"
#include "std/mutex.hpp"
#include "std/set.hpp"
#include "std/string.hpp"
#include "std/utility.hpp"
#include "std/vector.hpp"
#include <map>
class TrafficManager final
{
public:
@ -162,7 +163,7 @@ private:
size_t m_maxCacheSizeBytes;
size_t m_currentCacheSizeBytes = 0;
map<MwmSet::MwmId, CacheEntry> m_mwmCache;
std::map<MwmSet::MwmId, CacheEntry> m_mwmCache;
bool m_isRunning;
condition_variable m_condition;
@ -175,7 +176,7 @@ private:
// The ETag or entity tag is part of HTTP, the protocol for the World Wide Web.
// It is one of several mechanisms that HTTP provides for web cache validation,
// which allows a client to make conditional requests.
map<MwmSet::MwmId, string> m_trafficETags;
std::map<MwmSet::MwmId, string> m_trafficETags;
atomic<bool> m_isPaused;

View file

@ -6,11 +6,12 @@
#include "geometry/point2d.hpp"
#include "std/map.hpp"
#include "std/sstream.hpp"
#include "std/utility.hpp"
#include "std/vector.hpp"
#include <map>
namespace routing
{
class FeaturesRoadGraph;
@ -134,7 +135,7 @@ private:
return os.str();
}
using Links = map<Vertex, pair<Vertex, Edge>>;
using Links = std::map<Vertex, pair<Vertex, Edge>>;
using RoadGraphEdgesGetter = void (routing::IRoadGraph::*)(
routing::Junction const & junction, routing::IRoadGraph::EdgeVector & edges) const;
@ -176,7 +177,7 @@ private:
void GetIngoingEdges(routing::Junction const & u, routing::IRoadGraph::EdgeVector & edges);
void GetEdges(routing::Junction const & u, RoadGraphEdgesGetter getRegular,
RoadGraphEdgesGetter getFake,
map<routing::Junction, routing::IRoadGraph::EdgeVector> & cache,
std::map<routing::Junction, routing::IRoadGraph::EdgeVector> & cache,
routing::IRoadGraph::EdgeVector & edges);
template <typename Fn>
@ -211,8 +212,8 @@ private:
void FindSingleEdgeApproximation(vector<Edge> const & edges, vector<routing::Edge> & path);
routing::FeaturesRoadGraph & m_graph;
map<routing::Junction, routing::IRoadGraph::EdgeVector> m_outgoingCache;
map<routing::Junction, routing::IRoadGraph::EdgeVector> m_ingoingCache;
std::map<routing::Junction, routing::IRoadGraph::EdgeVector> m_outgoingCache;
std::map<routing::Junction, routing::IRoadGraph::EdgeVector> m_ingoingCache;
RoadInfoGetter & m_roadInfoGetter;
vector<WayPoint> m_points;

View file

@ -1,11 +1,12 @@
#pragma once
#include "std/function.hpp"
#include "std/map.hpp"
#include "std/string.hpp"
#include "std/utility.hpp"
#include "std/vector.hpp"
#include <map>
namespace marketing
{
// Tags.

View file

@ -1,5 +1,7 @@
#include "platform/marketing_service.hpp"
using namespace std;
void MarketingService::SendPushWooshTag(string const & tag)
{}

View file

@ -16,7 +16,7 @@ void MarketingService::SendPushWooshTag(string const & tag, vector<string> const
m_pushwooshSender(tag, values);
}
void MarketingService::SendMarketingEvent(string const & tag, map<string, string> const & params)
void MarketingService::SendMarketingEvent(string const & tag, std::map<string, string> const & params)
{
if (m_marketingSender)
m_marketingSender(tag, params);

View file

@ -64,11 +64,11 @@ void ChangeMaxNumberOfOpenFiles(size_t n)
namespace integration
{
shared_ptr<model::FeaturesFetcher> CreateFeaturesFetcher(vector<LocalCountryFile> const & localFiles)
shared_ptr<FeaturesFetcher> CreateFeaturesFetcher(vector<LocalCountryFile> const & localFiles)
{
size_t const maxOpenFileNumber = 4096;
ChangeMaxNumberOfOpenFiles(maxOpenFileNumber);
shared_ptr<model::FeaturesFetcher> featuresFetcher(new model::FeaturesFetcher);
shared_ptr<FeaturesFetcher> featuresFetcher(new FeaturesFetcher);
featuresFetcher->InitClassificator();
for (LocalCountryFile const & localFile : localFiles)

View file

@ -47,7 +47,7 @@ typedef std::pair<std::shared_ptr<Route>, RouterResultCode> TRouteResult;
namespace integration
{
std::shared_ptr<model::FeaturesFetcher> CreateFeaturesFetcher(
std::shared_ptr<FeaturesFetcher> CreateFeaturesFetcher(
std::vector<LocalCountryFile> const & localFiles);
std::unique_ptr<storage::CountryInfoGetter> CreateCountryInfoGetter();
@ -73,7 +73,7 @@ public:
storage::CountryInfoGetter const & GetCountryInfoGetter() const noexcept { return *m_infoGetter; }
protected:
std::shared_ptr<model::FeaturesFetcher> m_featuresFetcher;
std::shared_ptr<FeaturesFetcher> m_featuresFetcher;
std::unique_ptr<storage::CountryInfoGetter> m_infoGetter;
};

View file

@ -23,10 +23,11 @@
#include "3party/agg/agg_path_storage.h"
#include "std/cstdint.hpp"
#include "std/map.hpp"
#include "std/unique_ptr.hpp"
#include "std/vector.hpp"
#include <map>
namespace software_renderer
{
@ -115,7 +116,7 @@ public:
private:
unique_ptr<GlyphCache> m_glyphCache;
map<string, m2::RectU> m_symbolsIndex;
std::map<string, m2::RectU> m_symbolsIndex;
vector<uint8_t> m_symbolsSkin;
uint32_t m_skinWidth, m_skinHeight;

View file

@ -45,7 +45,6 @@
#include "std/condition_variable.hpp"
#include "std/exception.hpp"
#include "std/iterator.hpp"
#include "std/map.hpp"
#include "std/mutex.hpp"
#include "std/shared_ptr.hpp"
#include "std/unique_ptr.hpp"

View file

@ -10,11 +10,12 @@
#include "base/math.hpp"
#include "std/cstdint.hpp"
#include "std/map.hpp"
#include "std/sstream.hpp"
#include "std/string.hpp"
#include "std/vector.hpp"
#include <map>
#include "pyhelpers/module_version.hpp"
#include "pyhelpers/vector_list_conversion.hpp"
#include "pyhelpers/vector_uint8.hpp"
@ -40,7 +41,7 @@ struct SegmentSpeeds
double m_weight = 0;
};
using SegmentMapping = map<traffic::TrafficInfo::RoadSegmentId, SegmentSpeeds>;
using SegmentMapping = std::map<traffic::TrafficInfo::RoadSegmentId, SegmentSpeeds>;
string SegmentSpeedsRepr(SegmentSpeeds const & v)
{

View file

@ -5,10 +5,11 @@
#include "indexer/mwm_set.hpp"
#include "std/cstdint.hpp"
#include "std/map.hpp"
#include "std/shared_ptr.hpp"
#include "std/vector.hpp"
#include <map>
namespace platform
{
class HttpClient;
@ -74,7 +75,7 @@ public:
};
// todo(@m) unordered_map?
using Coloring = map<RoadSegmentId, SpeedGroup>;
using Coloring = std::map<RoadSegmentId, SpeedGroup>;
TrafficInfo() = default;

View file

@ -21,8 +21,8 @@
34921F661BFA0A6900737D6E /* api_mark_point.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 34921F611BFA0A6900737D6E /* api_mark_point.hpp */; };
34DDA1811DBE5DF40088A609 /* libpartners_api.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34DDA17F1DBE5DF40088A609 /* libpartners_api.a */; };
34DDA1821DBE5DF40088A609 /* libtracking.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 34DDA1801DBE5DF40088A609 /* libtracking.a */; };
393623A2233131CF00907D2E /* features_fetcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 393623A0233131CE00907D2E /* features_fetcher.cpp */; };
393623A3233131CF00907D2E /* features_fetcher.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 393623A1233131CF00907D2E /* features_fetcher.hpp */; };
39E3C60323312BA800FB0C37 /* features_fetcher.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 39E3C60123312BA800FB0C37 /* features_fetcher.hpp */; };
39E3C60423312BA800FB0C37 /* features_fetcher.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 39E3C60223312BA800FB0C37 /* features_fetcher.cpp */; };
3D0AEAFC1FBB0FF400AD042B /* libgenerator_tests_support.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D0AEAFF1FBB0FF400AD042B /* libgenerator_tests_support.a */; };
3D0AEAFE1FBB0FF400AD042B /* libsearch_tests_support.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D0AEB011FBB0FF400AD042B /* libsearch_tests_support.a */; };
3D1775A42317E2FD00F8889C /* promo_catalog_poi_checker.hpp in Headers */ = {isa = PBXBuildFile; fileRef = 3D1775A22317E2FD00F8889C /* promo_catalog_poi_checker.hpp */; };
@ -273,8 +273,8 @@
34AF87EA1DBE5AD000E5E7DC /* common-release.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; name = "common-release.xcconfig"; path = "../common-release.xcconfig"; sourceTree = "<group>"; };
34DDA17F1DBE5DF40088A609 /* libpartners_api.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libpartners_api.a; path = "/Users/igrechuhin/Repo/omim/xcode/partners_api/../../../omim-xcode-build/Debug/libpartners_api.a"; sourceTree = "<absolute>"; };
34DDA1801DBE5DF40088A609 /* libtracking.a */ = {isa = PBXFileReference; lastKnownFileType = archive.ar; name = libtracking.a; path = "/Users/igrechuhin/Repo/omim/xcode/tracking/../../../omim-xcode-build/Debug/libtracking.a"; sourceTree = "<absolute>"; };
393623A0233131CE00907D2E /* features_fetcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = features_fetcher.cpp; sourceTree = "<group>"; };
393623A1233131CF00907D2E /* features_fetcher.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = features_fetcher.hpp; sourceTree = "<group>"; };
39E3C60123312BA800FB0C37 /* features_fetcher.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = features_fetcher.hpp; sourceTree = "<group>"; };
39E3C60223312BA800FB0C37 /* features_fetcher.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = features_fetcher.cpp; sourceTree = "<group>"; };
3D0AEAFF1FBB0FF400AD042B /* libgenerator_tests_support.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libgenerator_tests_support.a; sourceTree = BUILT_PRODUCTS_DIR; };
3D0AEB001FBB0FF400AD042B /* libindexer_tests_support.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libindexer_tests_support.a; sourceTree = BUILT_PRODUCTS_DIR; };
3D0AEB011FBB0FF400AD042B /* libsearch_tests_support.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; path = libsearch_tests_support.a; sourceTree = BUILT_PRODUCTS_DIR; };
@ -817,8 +817,8 @@
675345BD1A4054AD00A0A8C3 /* map */ = {
isa = PBXGroup;
children = (
393623A0233131CE00907D2E /* features_fetcher.cpp */,
393623A1233131CF00907D2E /* features_fetcher.hpp */,
39E3C60223312BA800FB0C37 /* features_fetcher.cpp */,
39E3C60123312BA800FB0C37 /* features_fetcher.hpp */,
3D1775AA2319848500F8889C /* crown.cpp */,
3D1775A92319848500F8889C /* crown.hpp */,
3D1775A22317E2FD00F8889C /* promo_catalog_poi_checker.hpp */,
@ -974,7 +974,7 @@
675346671A4054E800A0A8C3 /* ge0_parser.hpp in Headers */,
675346A21A4054E800A0A8C3 /* user_mark.hpp in Headers */,
454649F21F2728CE00EF4064 /* local_ads_mark.hpp in Headers */,
393623A3233131CF00907D2E /* features_fetcher.hpp in Headers */,
39E3C60323312BA800FB0C37 /* features_fetcher.hpp in Headers */,
BBA014AE2073C784007402E4 /* bookmark_helpers.hpp in Headers */,
F6B283061C1B03320081957A /* gps_track_filter.hpp in Headers */,
3DD1166821888AAC007A2ED4 /* notification_queue_storage.hpp in Headers */,
@ -1220,7 +1220,7 @@
56C116602090E5670068BBC0 /* extrapolator.cpp in Sources */,
3D1775AC2319848500F8889C /* crown.cpp in Sources */,
40ACC79723191C2600238E21 /* check_mwms.cpp in Sources */,
393623A2233131CF00907D2E /* features_fetcher.cpp in Sources */,
39E3C60423312BA800FB0C37 /* features_fetcher.cpp in Sources */,
6753466A1A4054E800A0A8C3 /* geourl_process.cpp in Sources */,
3DD1166621888AAC007A2ED4 /* notification_queue_serdes.cpp in Sources */,
348AB57C1D7EE0C6009F8301 /* chart_generator.cpp in Sources */,