Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2018-03-23 16:56:06 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2018-03-23 19:52:14 +0300
commit87ea0ef32e99aa8315e99b6ea563ee1daec52c58 (patch)
tree5e8cc2f53715d787ede2a5062dc2f27ca5f29d8e
parentdaebd4db1c720278807bedff54262d1d1fe53951 (diff)
[base] Changed the namespace of Cancellable from my to base.
-rw-r--r--base/cancellable.hpp14
-rw-r--r--base/thread.hpp2
-rw-r--r--base/threaded_container.cpp2
-rw-r--r--base/threaded_container.hpp2
-rw-r--r--feature_list/feature_list.cpp2
-rw-r--r--generator/cities_boundaries_builder.cpp2
-rw-r--r--routing/base/astar_algorithm.hpp10
-rw-r--r--routing/bicycle_directions.cpp4
-rw-r--r--routing/bicycle_directions.hpp4
-rw-r--r--routing/directions_engine.hpp2
-rw-r--r--routing/pedestrian_directions.cpp4
-rw-r--r--routing/pedestrian_directions.hpp4
-rw-r--r--routing/router_delegate.hpp2
-rw-r--r--routing/routing_algorithm.cpp4
-rw-r--r--routing/routing_helpers.cpp2
-rw-r--r--routing/routing_helpers.hpp2
-rw-r--r--search/bookmarks/processor.cpp2
-rw-r--r--search/bookmarks/processor.hpp4
-rw-r--r--search/cancel_exception.hpp2
-rw-r--r--search/categories_cache.cpp6
-rw-r--r--search/categories_cache.hpp12
-rw-r--r--search/cities_boundaries_table.cpp2
-rw-r--r--search/city_finder.hpp2
-rw-r--r--search/features_layer_matcher.cpp3
-rw-r--r--search/features_layer_matcher.hpp4
-rw-r--r--search/features_layer_path_finder.cpp2
-rw-r--r--search/features_layer_path_finder.hpp6
-rw-r--r--search/geocoder.cpp6
-rw-r--r--search/geocoder.hpp4
-rw-r--r--search/geometry_cache.cpp7
-rw-r--r--search/geometry_cache.hpp10
-rw-r--r--search/processor.cpp8
-rw-r--r--search/processor.hpp2
-rw-r--r--search/ranker.cpp2
-rw-r--r--search/ranker.hpp4
-rw-r--r--search/retrieval.cpp12
-rw-r--r--search/retrieval.hpp4
-rw-r--r--search/search_integration_tests/pre_ranker_test.cpp8
-rw-r--r--search/search_integration_tests/processor_test.cpp2
-rw-r--r--search/search_tests/bookmarks_processor_tests.cpp2
-rw-r--r--search/search_tests/locality_finder_test.cpp2
41 files changed, 91 insertions, 89 deletions
diff --git a/base/cancellable.hpp b/base/cancellable.hpp
index 4eb5787769..a43713e1f2 100644
--- a/base/cancellable.hpp
+++ b/base/cancellable.hpp
@@ -2,10 +2,10 @@
#include <atomic>
-namespace my
+namespace base
{
-/// This class is a helper thread-safe class which can be mixed in
-/// classes which represent some cancellable activities.
+// This is a helper thread-safe class which can be mixed in
+// classes which represent some cancellable activities.
class Cancellable
{
public:
@@ -13,16 +13,16 @@ public:
virtual ~Cancellable() {}
- /// Marks current activity as not cancelled.
+ // Marks current activity as not cancelled.
virtual void Reset() { m_cancelled = false; }
- /// Marks current activity as cancelled.
+ // Marks current activity as cancelled.
virtual void Cancel() { m_cancelled = true; }
- /// \return True is current activity is cancelled.
+ // Returns true iff current activity has been cancelled.
virtual bool IsCancelled() const { return m_cancelled; }
private:
std::atomic<bool> m_cancelled;
};
-} // namespace my
+} // namespace base
diff --git a/base/thread.hpp b/base/thread.hpp
index 88eb7cdf20..e66bbf35a1 100644
--- a/base/thread.hpp
+++ b/base/thread.hpp
@@ -21,7 +21,7 @@
namespace threads
{
-class IRoutine : public my::Cancellable
+class IRoutine : public base::Cancellable
{
public:
/// Perform the main task.
diff --git a/base/threaded_container.cpp b/base/threaded_container.cpp
index c3e44a94e7..3daed01eeb 100644
--- a/base/threaded_container.cpp
+++ b/base/threaded_container.cpp
@@ -3,6 +3,6 @@
void ThreadedContainer::Cancel()
{
threads::ConditionGuard g(m_Cond);
- my::Cancellable::Cancel();
+ base::Cancellable::Cancel();
m_Cond.Signal(true);
}
diff --git a/base/threaded_container.hpp b/base/threaded_container.hpp
index 3e46abfb26..d5d2c004d8 100644
--- a/base/threaded_container.hpp
+++ b/base/threaded_container.hpp
@@ -4,7 +4,7 @@
#include "base/condition.hpp"
#include "base/timer.hpp"
-struct ThreadedContainer : public my::Cancellable
+struct ThreadedContainer : public base::Cancellable
{
protected:
diff --git a/feature_list/feature_list.cpp b/feature_list/feature_list.cpp
index c8de9eae6c..0209869649 100644
--- a/feature_list/feature_list.cpp
+++ b/feature_list/feature_list.cpp
@@ -171,7 +171,7 @@ void PrintAsCSV(vector<string> const & columns, char const delimiter, ostream &
class Processor
{
search::ReverseGeocoder m_geocoder;
- my::Cancellable m_cancellable;
+ base::Cancellable m_cancellable;
search::CitiesBoundariesTable m_boundariesTable;
search::VillagesCache m_villagesCache;
search::LocalityFinder m_finder;
diff --git a/generator/cities_boundaries_builder.cpp b/generator/cities_boundaries_builder.cpp
index 6d93cedf9a..5205d927c2 100644
--- a/generator/cities_boundaries_builder.cpp
+++ b/generator/cities_boundaries_builder.cpp
@@ -72,7 +72,7 @@ CBV GetLocalities(string const & dataPath)
CHECK_EQUAL(result.second, MwmSet::RegResult::Success, ("Can't register", dataPath));
search::MwmContext context(index.GetMwmHandleById(result.first));
- return search::CategoriesCache(LocalitiesSource{}, my::Cancellable{}).Get(context);
+ return search::CategoriesCache(LocalitiesSource{}, base::Cancellable{}).Get(context);
}
template <typename BoundariesTable, typename MappingReader>
diff --git a/routing/base/astar_algorithm.hpp b/routing/base/astar_algorithm.hpp
index 0e54fd4d8c..05407c3a24 100644
--- a/routing/base/astar_algorithm.hpp
+++ b/routing/base/astar_algorithm.hpp
@@ -56,7 +56,7 @@ public:
struct Params
{
Params(Graph & graph, Vertex const & startVertex, Vertex const & finalVertex,
- std::vector<Edge> const * prevRoute, my::Cancellable const & cancellable,
+ std::vector<Edge> const * prevRoute, base::Cancellable const & cancellable,
OnVisitedVertexCallback const & onVisitedVertexCallback,
CheckLengthCallback const & checkLengthCallback)
: m_graph(graph)
@@ -78,7 +78,7 @@ public:
Vertex const m_finalVertex;
// Used for AdjustRoute.
std::vector<Edge> const * const m_prevRoute;
- my::Cancellable const & m_cancellable;
+ base::Cancellable const & m_cancellable;
OnVisitedVertexCallback const m_onVisitedVertexCallback;
CheckLengthCallback const m_checkLengthCallback;
};
@@ -105,7 +105,7 @@ public:
Vertex const m_finalVertex;
// Used for AdjustRoute.
std::vector<Edge> const * const m_prevRoute;
- my::Cancellable const m_cancellable;
+ base::Cancellable const m_cancellable;
OnVisitedVertexCallback const m_onVisitedVertexCallback;
CheckLengthCallback const m_checkLengthCallback;
};
@@ -181,7 +181,7 @@ private:
class PeriodicPollCancellable final
{
public:
- PeriodicPollCancellable(my::Cancellable const & cancellable) : m_cancellable(cancellable) {}
+ PeriodicPollCancellable(base::Cancellable const & cancellable) : m_cancellable(cancellable) {}
bool IsCancelled()
{
@@ -191,7 +191,7 @@ private:
}
private:
- my::Cancellable const & m_cancellable;
+ base::Cancellable const & m_cancellable;
uint32_t count = 0;
};
diff --git a/routing/bicycle_directions.cpp b/routing/bicycle_directions.cpp
index 8a504c8eba..94cda85cb0 100644
--- a/routing/bicycle_directions.cpp
+++ b/routing/bicycle_directions.cpp
@@ -166,7 +166,7 @@ BicycleDirectionsEngine::BicycleDirectionsEngine(Index const & index, shared_ptr
}
bool BicycleDirectionsEngine::Generate(IndexRoadGraph const & graph, vector<Junction> const & path,
- my::Cancellable const & cancellable, Route::TTurns & turns,
+ base::Cancellable const & cancellable, Route::TTurns & turns,
Route::TStreets & streetNames,
vector<Junction> & routeGeometry, vector<Segment> & segments)
{
@@ -304,7 +304,7 @@ void BicycleDirectionsEngine::GetEdges(RoadGraphBase const & graph, Junction con
void BicycleDirectionsEngine::FillPathSegmentsAndAdjacentEdgesMap(
IndexRoadGraph const & graph, vector<Junction> const & path,
- IRoadGraph::TEdgeVector const & routeEdges, my::Cancellable const & cancellable)
+ IRoadGraph::TEdgeVector const & routeEdges, base::Cancellable const & cancellable)
{
size_t const pathSize = path.size();
CHECK_GREATER(pathSize, 1, ());
diff --git a/routing/bicycle_directions.hpp b/routing/bicycle_directions.hpp
index 7dd85e91f9..a21c82743c 100644
--- a/routing/bicycle_directions.hpp
+++ b/routing/bicycle_directions.hpp
@@ -32,7 +32,7 @@ public:
// IDirectionsEngine override:
bool Generate(IndexRoadGraph const & graph, vector<Junction> const & path,
- my::Cancellable const & cancellable, Route::TTurns & turns,
+ base::Cancellable const & cancellable, Route::TTurns & turns,
Route::TStreets & streetNames, vector<Junction> & routeGeometry,
vector<Segment> & segments) override;
@@ -48,7 +48,7 @@ private:
void FillPathSegmentsAndAdjacentEdgesMap(IndexRoadGraph const & graph,
std::vector<Junction> const & path,
IRoadGraph::TEdgeVector const & routeEdges,
- my::Cancellable const & cancellable);
+ base::Cancellable const & cancellable);
void GetEdges(RoadGraphBase const & graph, Junction const & currJunction,
bool isCurrJunctionFinish, IRoadGraph::TEdgeVector & outgoing,
diff --git a/routing/directions_engine.hpp b/routing/directions_engine.hpp
index 33d65bda0c..e2b2a2f2c0 100644
--- a/routing/directions_engine.hpp
+++ b/routing/directions_engine.hpp
@@ -24,7 +24,7 @@ public:
/// \param path is points of the route. It should not be empty.
/// \returns true if fields passed by reference are filled correctly and false otherwise.
virtual bool Generate(IndexRoadGraph const & graph, vector<Junction> const & path,
- my::Cancellable const & cancellable, Route::TTurns & turns,
+ base::Cancellable const & cancellable, Route::TTurns & turns,
Route::TStreets & streetNames, vector<Junction> & routeGeometry,
vector<Segment> & segments) = 0;
};
diff --git a/routing/pedestrian_directions.cpp b/routing/pedestrian_directions.cpp
index 7694dea3ab..5f659d7c8a 100644
--- a/routing/pedestrian_directions.cpp
+++ b/routing/pedestrian_directions.cpp
@@ -41,7 +41,7 @@ PedestrianDirectionsEngine::PedestrianDirectionsEngine(shared_ptr<NumMwmIds> num
bool PedestrianDirectionsEngine::Generate(IndexRoadGraph const & graph,
vector<Junction> const & path,
- my::Cancellable const & cancellable,
+ base::Cancellable const & cancellable,
Route::TTurns & turns, Route::TStreets & streetNames,
vector<Junction> & routeGeometry,
vector<Segment> & segments)
@@ -67,7 +67,7 @@ bool PedestrianDirectionsEngine::Generate(IndexRoadGraph const & graph,
void PedestrianDirectionsEngine::CalculateTurns(IndexRoadGraph const & graph,
vector<Edge> const & routeEdges,
Route::TTurns & turns,
- my::Cancellable const & cancellable) const
+ base::Cancellable const & cancellable) const
{
for (size_t i = 0; i < routeEdges.size(); ++i)
{
diff --git a/routing/pedestrian_directions.hpp b/routing/pedestrian_directions.hpp
index d772513483..ec889cc082 100644
--- a/routing/pedestrian_directions.hpp
+++ b/routing/pedestrian_directions.hpp
@@ -16,13 +16,13 @@ public:
// IDirectionsEngine override:
bool Generate(IndexRoadGraph const & graph, vector<Junction> const & path,
- my::Cancellable const & cancellable, Route::TTurns & turns,
+ base::Cancellable const & cancellable, Route::TTurns & turns,
Route::TStreets & streetNames, vector<Junction> & routeGeometry,
vector<Segment> & segments) override;
private:
void CalculateTurns(IndexRoadGraph const & graph, std::vector<Edge> const & routeEdges,
- Route::TTurns & turnsDir, my::Cancellable const & cancellable) const;
+ Route::TTurns & turnsDir, base::Cancellable const & cancellable) const;
uint32_t const m_typeSteps;
uint32_t const m_typeLiftGate;
diff --git a/routing/router_delegate.hpp b/routing/router_delegate.hpp
index 15303fa1a7..7e07a908c8 100644
--- a/routing/router_delegate.hpp
+++ b/routing/router_delegate.hpp
@@ -10,7 +10,7 @@
namespace routing
{
-class TimeoutCancellable : public my::Cancellable
+class TimeoutCancellable : public base::Cancellable
{
public:
TimeoutCancellable();
diff --git a/routing/routing_algorithm.cpp b/routing/routing_algorithm.cpp
index 3da9cffc27..cc02d28a1c 100644
--- a/routing/routing_algorithm.cpp
+++ b/routing/routing_algorithm.cpp
@@ -154,7 +154,7 @@ IRoutingAlgorithm::Result AStarRoutingAlgorithm::CalculateRoute(IRoadGraph const
};
- my::Cancellable const & cancellable = delegate;
+ base::Cancellable const & cancellable = delegate;
progress.Initialize(startPos.GetPoint(), finalPos.GetPoint());
RoadGraph roadGraph(graph);
TAlgorithmImpl::Params params(roadGraph, startPos, finalPos, nullptr /* prevRoute */, cancellable,
@@ -184,7 +184,7 @@ IRoutingAlgorithm::Result AStarBidirectionalRoutingAlgorithm::CalculateRoute(
delegate.OnProgress(newValue);
};
- my::Cancellable const & cancellable = delegate;
+ base::Cancellable const & cancellable = delegate;
progress.Initialize(startPos.GetPoint(), finalPos.GetPoint());
RoadGraph roadGraph(graph);
TAlgorithmImpl::Params params(roadGraph, startPos, finalPos, {} /* prevRoute */, cancellable,
diff --git a/routing/routing_helpers.cpp b/routing/routing_helpers.cpp
index c0b1101675..23679c3459 100644
--- a/routing/routing_helpers.cpp
+++ b/routing/routing_helpers.cpp
@@ -100,7 +100,7 @@ void FillSegmentInfo(vector<Segment> const & segments, vector<Junction> const &
void ReconstructRoute(IDirectionsEngine & engine, IndexRoadGraph const & graph,
shared_ptr<TrafficStash> const & trafficStash,
- my::Cancellable const & cancellable, vector<Junction> const & path,
+ base::Cancellable const & cancellable, vector<Junction> const & path,
Route::TTimes && times, Route & route)
{
if (path.empty())
diff --git a/routing/routing_helpers.hpp b/routing/routing_helpers.hpp
index f3dc3d752f..d266c2fbd3 100644
--- a/routing/routing_helpers.hpp
+++ b/routing/routing_helpers.hpp
@@ -36,7 +36,7 @@ void FillSegmentInfo(std::vector<Segment> const & segments, std::vector<Junction
void ReconstructRoute(IDirectionsEngine & engine, IndexRoadGraph const & graph,
std::shared_ptr<TrafficStash> const & trafficStash,
- my::Cancellable const & cancellable, std::vector<Junction> const & path,
+ base::Cancellable const & cancellable, std::vector<Junction> const & path,
Route::TTimes && times, Route & route);
/// \brief Converts |edge| to |segment|.
diff --git a/search/bookmarks/processor.cpp b/search/bookmarks/processor.cpp
index 1ee6b02d4d..d44b2fa66f 100644
--- a/search/bookmarks/processor.cpp
+++ b/search/bookmarks/processor.cpp
@@ -72,7 +72,7 @@ void FillRankingInfo(QueryVec & qv, IdfMap & idfs, DocVec const & dv, RankingInf
}
} // namespace
-Processor::Processor(Emitter & emitter, my::Cancellable const & cancellable)
+Processor::Processor(Emitter & emitter, ::base::Cancellable const & cancellable)
: m_emitter(emitter), m_cancellable(cancellable)
{
}
diff --git a/search/bookmarks/processor.hpp b/search/bookmarks/processor.hpp
index dd8b468c39..059be529a3 100644
--- a/search/bookmarks/processor.hpp
+++ b/search/bookmarks/processor.hpp
@@ -31,7 +31,7 @@ class Processor : public IdfMap::Delegate
public:
using Index = base::MemSearchIndex<Id>;
- Processor(Emitter & emitter, my::Cancellable const & cancellable);
+ Processor(Emitter & emitter, ::base::Cancellable const & cancellable);
~Processor() override = default;
void Add(Id const & id, Doc const & doc);
@@ -63,7 +63,7 @@ private:
QueryVec GetQueryVec(IdfMap & idfs, QueryParams const & params) const;
Emitter & m_emitter;
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
Index m_index;
std::unordered_map<Id, DocVec> m_docs;
diff --git a/search/cancel_exception.hpp b/search/cancel_exception.hpp
index 191f9f150d..75126df280 100644
--- a/search/cancel_exception.hpp
+++ b/search/cancel_exception.hpp
@@ -11,7 +11,7 @@ namespace search
// geometry retrieval for fast cancellation of time-consuming tasks.
DECLARE_EXCEPTION(CancelException, RootException);
-inline void BailIfCancelled(my::Cancellable const & cancellable)
+inline void BailIfCancelled(::base::Cancellable const & cancellable)
{
if (cancellable.IsCancelled())
MYTHROW(CancelException, ("Cancelled"));
diff --git a/search/categories_cache.cpp b/search/categories_cache.cpp
index a840fde128..336967f3ec 100644
--- a/search/categories_cache.cpp
+++ b/search/categories_cache.cpp
@@ -51,19 +51,19 @@ CBV CategoriesCache::Load(MwmContext const & context) const
}
// StreetsCache ------------------------------------------------------------------------------------
-StreetsCache::StreetsCache(my::Cancellable const & cancellable)
+StreetsCache::StreetsCache(::base::Cancellable const & cancellable)
: CategoriesCache(ftypes::IsStreetChecker::Instance(), cancellable)
{
}
// VillagesCache -----------------------------------------------------------------------------------
-VillagesCache::VillagesCache(my::Cancellable const & cancellable)
+VillagesCache::VillagesCache(::base::Cancellable const & cancellable)
: CategoriesCache(ftypes::IsVillageChecker::Instance(), cancellable)
{
}
// HotelsCache -------------------------------------------------------------------------------------
-HotelsCache::HotelsCache(my::Cancellable const & cancellable)
+HotelsCache::HotelsCache(::base::Cancellable const & cancellable)
: CategoriesCache(ftypes::IsHotelChecker::Instance(), cancellable)
{
}
diff --git a/search/categories_cache.hpp b/search/categories_cache.hpp
index 3e14ef0699..755161fe99 100644
--- a/search/categories_cache.hpp
+++ b/search/categories_cache.hpp
@@ -18,13 +18,13 @@ class CategoriesCache
{
public:
template <typename TypesSource>
- CategoriesCache(TypesSource const & source, my::Cancellable const & cancellable)
+ CategoriesCache(TypesSource const & source, ::base::Cancellable const & cancellable)
: m_cancellable(cancellable)
{
source.ForEachType([this](uint32_t type) { m_categories.Add(type); });
}
- CategoriesCache(set<uint32_t> const & types, my::Cancellable const & cancellable)
+ CategoriesCache(set<uint32_t> const & types, ::base::Cancellable const & cancellable)
: m_cancellable(cancellable)
{
for (uint32_t type : types)
@@ -41,25 +41,25 @@ private:
CBV Load(MwmContext const & context) const;
CategoriesSet m_categories;
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
map<MwmSet::MwmId, CBV> m_cache;
};
class StreetsCache : public CategoriesCache
{
public:
- StreetsCache(my::Cancellable const & cancellable);
+ StreetsCache(::base::Cancellable const & cancellable);
};
class VillagesCache : public CategoriesCache
{
public:
- VillagesCache(my::Cancellable const & cancellable);
+ VillagesCache(::base::Cancellable const & cancellable);
};
class HotelsCache : public CategoriesCache
{
public:
- HotelsCache(my::Cancellable const & cancellable);
+ HotelsCache(::base::Cancellable const & cancellable);
};
} // namespace search
diff --git a/search/cities_boundaries_table.cpp b/search/cities_boundaries_table.cpp
index 81b30649b0..c6e4592485 100644
--- a/search/cities_boundaries_table.cpp
+++ b/search/cities_boundaries_table.cpp
@@ -44,7 +44,7 @@ bool CitiesBoundariesTable::Load()
return true;
MwmContext context(move(handle));
- auto const localities = CategoriesCache(LocalitiesSource{}, my::Cancellable{}).Get(context);
+ auto const localities = CategoriesCache(LocalitiesSource{}, ::base::Cancellable{}).Get(context);
auto const & cont = context.m_value.m_cont;
diff --git a/search/city_finder.hpp b/search/city_finder.hpp
index 53243706bb..cb17870df9 100644
--- a/search/city_finder.hpp
+++ b/search/city_finder.hpp
@@ -26,7 +26,7 @@ public:
FeatureID GetCityFeatureID(m2::PointD const & p);
private:
- my::Cancellable m_cancellable;
+ ::base::Cancellable m_cancellable;
search::CitiesBoundariesTable m_unusedBoundaries;
search::VillagesCache m_unusedCache;
search::LocalityFinder m_finder;
diff --git a/search/features_layer_matcher.cpp b/search/features_layer_matcher.cpp
index c947f52dd6..c229f04be4 100644
--- a/search/features_layer_matcher.cpp
+++ b/search/features_layer_matcher.cpp
@@ -13,7 +13,8 @@ namespace search
/// even if there is no exact street written for this house.
int constexpr kMaxApproxStreetDistanceM = 100;
-FeaturesLayerMatcher::FeaturesLayerMatcher(Index const & index, my::Cancellable const & cancellable)
+FeaturesLayerMatcher::FeaturesLayerMatcher(Index const & index,
+ ::base::Cancellable const & cancellable)
: m_context(nullptr)
, m_postcodes(nullptr)
, m_reverseGeocoder(index)
diff --git a/search/features_layer_matcher.hpp b/search/features_layer_matcher.hpp
index 9cac8e9fbc..111baf3daa 100644
--- a/search/features_layer_matcher.hpp
+++ b/search/features_layer_matcher.hpp
@@ -61,7 +61,7 @@ public:
static int constexpr kBuildingRadiusMeters = 50;
static int constexpr kStreetRadiusMeters = 100;
- FeaturesLayerMatcher(Index const & index, my::Cancellable const & cancellable);
+ FeaturesLayerMatcher(Index const & index, ::base::Cancellable const & cancellable);
void SetContext(MwmContext * context);
void SetPostcodes(CBV const * postcodes);
@@ -396,6 +396,6 @@ private:
Cache<uint32_t, uint32_t> m_matchingStreetsCache;
StreetVicinityLoader m_loader;
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
};
} // namespace search
diff --git a/search/features_layer_path_finder.cpp b/search/features_layer_path_finder.cpp
index 618f42bf51..711c12251f 100644
--- a/search/features_layer_path_finder.cpp
+++ b/search/features_layer_path_finder.cpp
@@ -73,7 +73,7 @@ bool MayHaveDelayedFeatures(FeaturesLayer const & layer)
}
} // namespace
-FeaturesLayerPathFinder::FeaturesLayerPathFinder(my::Cancellable const & cancellable)
+FeaturesLayerPathFinder::FeaturesLayerPathFinder(::base::Cancellable const & cancellable)
: m_cancellable(cancellable)
{
}
diff --git a/search/features_layer_path_finder.hpp b/search/features_layer_path_finder.hpp
index f2a3a9b3f3..0af748a4a8 100644
--- a/search/features_layer_path_finder.hpp
+++ b/search/features_layer_path_finder.hpp
@@ -13,7 +13,7 @@
class FeaturesVector;
class MwmValue;
-namespace my
+namespace base
{
class Cancellable;
}
@@ -45,7 +45,7 @@ public:
MODE_BOTTOM_UP
};
- FeaturesLayerPathFinder(my::Cancellable const & cancellable);
+ FeaturesLayerPathFinder(::base::Cancellable const & cancellable);
template <typename TFn>
void ForEachReachableVertex(FeaturesLayerMatcher & matcher,
@@ -92,7 +92,7 @@ private:
vector<FeaturesLayer const *> const & layers,
vector<IntersectionResult> & results);
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
static Mode m_mode;
};
diff --git a/search/geocoder.cpp b/search/geocoder.cpp
index 97751780a6..4a02024900 100644
--- a/search/geocoder.cpp
+++ b/search/geocoder.cpp
@@ -158,7 +158,7 @@ class LocalityScorerDelegate : public LocalityScorer::Delegate
{
public:
LocalityScorerDelegate(MwmContext const & context, Geocoder::Params const & params,
- my::Cancellable const & cancellable)
+ ::base::Cancellable const & cancellable)
: m_context(context)
, m_params(params)
, m_cancellable(cancellable)
@@ -204,7 +204,7 @@ public:
private:
MwmContext const & m_context;
Geocoder::Params const & m_params;
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
Retrieval m_retrieval;
@@ -338,7 +338,7 @@ size_t OrderCountries(m2::RectD const & pivot, vector<shared_ptr<MwmInfo>> & inf
// Geocoder::Geocoder ------------------------------------------------------------------------------
Geocoder::Geocoder(Index const & index, storage::CountryInfoGetter const & infoGetter,
CategoriesHolder const & categories, PreRanker & preRanker,
- VillagesCache & villagesCache, my::Cancellable const & cancellable)
+ VillagesCache & villagesCache, ::base::Cancellable const & cancellable)
: m_index(index)
, m_infoGetter(infoGetter)
, m_categories(categories)
diff --git a/search/geocoder.hpp b/search/geocoder.hpp
index 26b3f63f65..94915467a9 100644
--- a/search/geocoder.hpp
+++ b/search/geocoder.hpp
@@ -89,7 +89,7 @@ public:
Geocoder(Index const & index, storage::CountryInfoGetter const & infoGetter,
CategoriesHolder const & categories, PreRanker & preRanker,
- VillagesCache & villagesCache, my::Cancellable const & cancellable);
+ VillagesCache & villagesCache, ::base::Cancellable const & cancellable);
~Geocoder();
// Sets search query params.
@@ -248,7 +248,7 @@ private:
HotelsCache m_hotelsCache;
hotels_filter::HotelsFilter m_hotelsFilter;
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
// Geocoder params.
Params m_params;
diff --git a/search/geometry_cache.cpp b/search/geometry_cache.cpp
index 172e81c442..abe8af5885 100644
--- a/search/geometry_cache.cpp
+++ b/search/geometry_cache.cpp
@@ -14,7 +14,7 @@ double constexpr kCellEps = MercatorBounds::GetCellID2PointAbsEpsilon();
} // namespace
// GeometryCache -----------------------------------------------------------------------------------
-GeometryCache::GeometryCache(size_t maxNumEntries, my::Cancellable const & cancellable)
+GeometryCache::GeometryCache(size_t maxNumEntries, ::base::Cancellable const & cancellable)
: m_maxNumEntries(maxNumEntries), m_cancellable(cancellable)
{
CHECK_GREATER(m_maxNumEntries, 0, ());
@@ -31,7 +31,7 @@ void GeometryCache::InitEntry(MwmContext const & context, m2::RectD const & rect
}
// PivotRectsCache ---------------------------------------------------------------------------------
-PivotRectsCache::PivotRectsCache(size_t maxNumEntries, my::Cancellable const & cancellable,
+PivotRectsCache::PivotRectsCache(size_t maxNumEntries, ::base::Cancellable const & cancellable,
double maxRadiusMeters)
: GeometryCache(maxNumEntries, cancellable), m_maxRadiusMeters(maxRadiusMeters)
{
@@ -58,7 +58,8 @@ CBV PivotRectsCache::Get(MwmContext const & context, m2::RectD const & rect, int
}
// LocalityRectsCache ------------------------------------------------------------------------------
-LocalityRectsCache::LocalityRectsCache(size_t maxNumEntries, my::Cancellable const & cancellable)
+LocalityRectsCache::LocalityRectsCache(size_t maxNumEntries,
+ ::base::Cancellable const & cancellable)
: GeometryCache(maxNumEntries, cancellable)
{
}
diff --git a/search/geometry_cache.hpp b/search/geometry_cache.hpp
index 2b36707cc2..0dbde6420d 100644
--- a/search/geometry_cache.hpp
+++ b/search/geometry_cache.hpp
@@ -15,7 +15,7 @@
#include "std/unique_ptr.hpp"
#include "std/utility.hpp"
-namespace my
+namespace base
{
class Cancellable;
};
@@ -49,7 +49,7 @@ protected:
// |maxNumEntries| denotes the maximum number of rectangles that
// will be cached for each mwm individually.
- GeometryCache(size_t maxNumEntries, my::Cancellable const & cancellable);
+ GeometryCache(size_t maxNumEntries, ::base::Cancellable const & cancellable);
template <typename TPred>
pair<Entry &, bool> FindOrCreateEntry(MwmSet::MwmId const & id, TPred && pred)
@@ -76,13 +76,13 @@ protected:
map<MwmSet::MwmId, deque<Entry>> m_entries;
size_t const m_maxNumEntries;
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
};
class PivotRectsCache : public GeometryCache
{
public:
- PivotRectsCache(size_t maxNumEntries, my::Cancellable const & cancellable,
+ PivotRectsCache(size_t maxNumEntries, ::base::Cancellable const & cancellable,
double maxRadiusMeters);
// GeometryCache overrides:
@@ -95,7 +95,7 @@ private:
class LocalityRectsCache : public GeometryCache
{
public:
- LocalityRectsCache(size_t maxNumEntries, my::Cancellable const & cancellable);
+ LocalityRectsCache(size_t maxNumEntries, ::base::Cancellable const & cancellable);
// GeometryCache overrides:
CBV Get(MwmContext const & context, m2::RectD const & rect, int scale) override;
diff --git a/search/processor.cpp b/search/processor.cpp
index 88c1fd7ec7..ebf7309690 100644
--- a/search/processor.cpp
+++ b/search/processor.cpp
@@ -147,15 +147,15 @@ Processor::Processor(Index const & index, CategoriesHolder const & categories,
: m_categories(categories)
, m_infoGetter(infoGetter)
, m_position(0, 0)
- , m_villagesCache(static_cast<my::Cancellable const &>(*this))
+ , m_villagesCache(static_cast<::base::Cancellable const &>(*this))
, m_citiesBoundaries(index)
, m_keywordsScorer(LanguageTier::LANGUAGE_TIER_COUNT)
, m_ranker(index, m_citiesBoundaries, infoGetter, m_keywordsScorer, m_emitter, categories,
- suggests, m_villagesCache, static_cast<my::Cancellable const &>(*this))
+ suggests, m_villagesCache, static_cast<::base::Cancellable const &>(*this))
, m_preRanker(index, m_ranker)
, m_geocoder(index, infoGetter, categories, m_preRanker, m_villagesCache,
- static_cast<my::Cancellable const &>(*this))
- , m_bookmarksProcessor(m_emitter, static_cast<my::Cancellable const &>(*this))
+ static_cast<::base::Cancellable const &>(*this))
+ , m_bookmarksProcessor(m_emitter, static_cast<::base::Cancellable const &>(*this))
{
// Current and input langs are to be set later.
m_keywordsScorer.SetLanguages(
diff --git a/search/processor.hpp b/search/processor.hpp
index 50a34f3491..aabdce11d8 100644
--- a/search/processor.hpp
+++ b/search/processor.hpp
@@ -54,7 +54,7 @@ class QueryParams;
class Ranker;
class ReverseGeocoder;
-class Processor : public my::Cancellable
+class Processor : public ::base::Cancellable
{
public:
// Maximum result candidates count for each viewport/criteria.
diff --git a/search/ranker.cpp b/search/ranker.cpp
index 6e203751c6..740d7a9365 100644
--- a/search/ranker.cpp
+++ b/search/ranker.cpp
@@ -360,7 +360,7 @@ Ranker::Ranker(Index const & index, CitiesBoundariesTable const & boundariesTabl
storage::CountryInfoGetter const & infoGetter, KeywordLangMatcher & keywordsScorer,
Emitter & emitter, CategoriesHolder const & categories,
vector<Suggest> const & suggests, VillagesCache & villagesCache,
- my::Cancellable const & cancellable)
+ ::base::Cancellable const & cancellable)
: m_reverseGeocoder(index)
, m_cancellable(cancellable)
, m_keywordsScorer(keywordsScorer)
diff --git a/search/ranker.hpp b/search/ranker.hpp
index a61c213239..01f93c8c89 100644
--- a/search/ranker.hpp
+++ b/search/ranker.hpp
@@ -83,7 +83,7 @@ public:
storage::CountryInfoGetter const & infoGetter, KeywordLangMatcher & keywordsScorer,
Emitter & emitter, CategoriesHolder const & categories,
std::vector<Suggest> const & suggests, VillagesCache & villagesCache,
- my::Cancellable const & cancellable);
+ ::base::Cancellable const & cancellable);
virtual ~Ranker() = default;
void Init(Params const & params, Geocoder::Params const & geocoderParams);
@@ -127,7 +127,7 @@ private:
Params m_params;
Geocoder::Params m_geocoderParams;
ReverseGeocoder const m_reverseGeocoder;
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
KeywordLangMatcher & m_keywordsScorer;
mutable LocalityFinder m_localities;
diff --git a/search/retrieval.cpp b/search/retrieval.cpp
index 9e60e747e5..6cf101bfcc 100644
--- a/search/retrieval.cpp
+++ b/search/retrieval.cpp
@@ -40,7 +40,7 @@ namespace
class FeaturesCollector
{
public:
- FeaturesCollector(my::Cancellable const & cancellable, vector<uint64_t> & features)
+ FeaturesCollector(::base::Cancellable const & cancellable, vector<uint64_t> & features)
: m_cancellable(cancellable), m_features(features), m_counter(0)
{
}
@@ -58,7 +58,7 @@ public:
inline void operator()(uint64_t feature) { m_features.push_back(feature); }
private:
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
vector<uint64_t> & m_features;
uint32_t m_counter;
};
@@ -200,7 +200,7 @@ bool MatchFeatureByPostcode(FeatureType const & ft, TokenSlice const & slice)
template <typename Value, typename DFA>
unique_ptr<coding::CompressedBitVector> RetrieveAddressFeaturesImpl(
Retrieval::TrieRoot<Value> const & root, MwmContext const & context,
- my::Cancellable const & cancellable, SearchTrieRequest<DFA> const & request)
+ ::base::Cancellable const & cancellable, SearchTrieRequest<DFA> const & request)
{
EditedFeaturesHolder holder(context.GetId());
vector<uint64_t> features;
@@ -224,7 +224,7 @@ unique_ptr<coding::CompressedBitVector> RetrieveAddressFeaturesImpl(
template <typename Value>
unique_ptr<coding::CompressedBitVector> RetrievePostcodeFeaturesImpl(
Retrieval::TrieRoot<Value> const & root, MwmContext const & context,
- my::Cancellable const & cancellable, TokenSlice const & slice)
+ ::base::Cancellable const & cancellable, TokenSlice const & slice)
{
EditedFeaturesHolder holder(context.GetId());
vector<uint64_t> features;
@@ -246,7 +246,7 @@ unique_ptr<coding::CompressedBitVector> RetrievePostcodeFeaturesImpl(
}
unique_ptr<coding::CompressedBitVector> RetrieveGeometryFeaturesImpl(
- MwmContext const & context, my::Cancellable const & cancellable, m2::RectD const & rect,
+ MwmContext const & context, ::base::Cancellable const & cancellable, m2::RectD const & rect,
int scale)
{
EditedFeaturesHolder holder(context.GetId());
@@ -297,7 +297,7 @@ unique_ptr<Retrieval::TrieRoot<Value>> ReadTrie(MwmValue & value, ModelReaderPtr
}
} // namespace
-Retrieval::Retrieval(MwmContext const & context, my::Cancellable const & cancellable)
+Retrieval::Retrieval(MwmContext const & context, ::base::Cancellable const & cancellable)
: m_context(context)
, m_cancellable(cancellable)
, m_reader(context.m_value.m_cont.GetReader(SEARCH_INDEX_FILE_TAG))
diff --git a/search/retrieval.hpp b/search/retrieval.hpp
index 81da60d749..0be660e017 100644
--- a/search/retrieval.hpp
+++ b/search/retrieval.hpp
@@ -33,7 +33,7 @@ public:
template<typename Value>
using TrieRoot = trie::Iterator<ValueList<Value>>;
- Retrieval(MwmContext const & context, my::Cancellable const & cancellable);
+ Retrieval(MwmContext const & context, ::base::Cancellable const & cancellable);
// Following functions retrieve from the search index corresponding to
// |value| all features matching to |request|.
@@ -62,7 +62,7 @@ private:
unique_ptr<coding::CompressedBitVector> Retrieve(Args &&... args) const;
MwmContext const & m_context;
- my::Cancellable const & m_cancellable;
+ ::base::Cancellable const & m_cancellable;
ModelReaderPtr m_reader;
version::MwmTraits::SearchIndexFormat m_format;
diff --git a/search/search_integration_tests/pre_ranker_test.cpp b/search/search_integration_tests/pre_ranker_test.cpp
index 9c7387a77e..d18398927a 100644
--- a/search/search_integration_tests/pre_ranker_test.cpp
+++ b/search/search_integration_tests/pre_ranker_test.cpp
@@ -55,9 +55,9 @@ public:
TestRanker(Index & index, storage::CountryInfoGetter & infoGetter,
CitiesBoundariesTable const & boundariesTable, KeywordLangMatcher & keywordsScorer,
Emitter & emitter, vector<Suggest> const & suggests, VillagesCache & villagesCache,
- my::Cancellable const & cancellable, vector<PreRankerResult> & results)
- : Ranker(index, boundariesTable, infoGetter, keywordsScorer, emitter,
- GetDefaultCategories(), suggests, villagesCache, cancellable)
+ ::base::Cancellable const & cancellable, vector<PreRankerResult> & results)
+ : Ranker(index, boundariesTable, infoGetter, keywordsScorer, emitter, GetDefaultCategories(),
+ suggests, villagesCache, cancellable)
, m_results(results)
{
}
@@ -88,7 +88,7 @@ class PreRankerTest : public SearchTest
{
public:
vector<Suggest> m_suggests;
- my::Cancellable m_cancellable;
+ ::base::Cancellable m_cancellable;
};
UNIT_CLASS_TEST(PreRankerTest, Smoke)
diff --git a/search/search_integration_tests/processor_test.cpp b/search/search_integration_tests/processor_test.cpp
index f4202e5b50..5c2becc049 100644
--- a/search/search_integration_tests/processor_test.cpp
+++ b/search/search_integration_tests/processor_test.cpp
@@ -568,7 +568,7 @@ UNIT_CLASS_TEST(ProcessorTest, TestPostcodes)
// Tests that postcode is added to the search index.
{
MwmContext context(m_index.GetMwmHandleById(countryId));
- my::Cancellable cancellable;
+ ::base::Cancellable cancellable;
QueryParams params;
{
diff --git a/search/search_tests/bookmarks_processor_tests.cpp b/search/search_tests/bookmarks_processor_tests.cpp
index 8c17fc03b7..ff37af318f 100644
--- a/search/search_tests/bookmarks_processor_tests.cpp
+++ b/search/search_tests/bookmarks_processor_tests.cpp
@@ -57,7 +57,7 @@ public:
protected:
Emitter m_emitter;
- my::Cancellable m_cancellable;
+ ::base::Cancellable m_cancellable;
Processor m_processor;
};
diff --git a/search/search_tests/locality_finder_test.cpp b/search/search_tests/locality_finder_test.cpp
index 12bdbdf178..4a062dac86 100644
--- a/search/search_tests/locality_finder_test.cpp
+++ b/search/search_tests/locality_finder_test.cpp
@@ -24,7 +24,7 @@ class LocalityFinderTest : public indexer::tests_support::TestWithClassificator
Index m_index;
- my::Cancellable m_cancellable;
+ ::base::Cancellable m_cancellable;
search::VillagesCache m_villagesCache;
search::CitiesBoundariesTable m_boundariesTable;