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
path: root/search
diff options
context:
space:
mode:
authorYuri Gorshenin <y@maps.me>2016-09-12 17:37:53 +0300
committerYuri Gorshenin <y@maps.me>2016-09-12 17:37:53 +0300
commitacb60bab22c2780f8e0bc8cd695392afd9715c1d (patch)
tree6711ee3a7d4aa7da070b04c24e9dfa74ed901c85 /search
parent96682f747663b5c3d1d8166c0f5ef340d8e8211f (diff)
Review fixes.
Diffstat (limited to 'search')
-rw-r--r--search/emitter.hpp6
-rw-r--r--search/processor.cpp2
-rw-r--r--search/ranker.cpp9
-rw-r--r--search/ranker.hpp4
-rw-r--r--search/search_integration_tests/pre_ranker_test.cpp2
5 files changed, 15 insertions, 8 deletions
diff --git a/search/emitter.hpp b/search/emitter.hpp
index 8989a5ef09..eb51542932 100644
--- a/search/emitter.hpp
+++ b/search/emitter.hpp
@@ -3,6 +3,8 @@
#include "search/result.hpp"
#include "search/search_params.hpp"
+#include "base/logging.hpp"
+
namespace search
{
class Emitter
@@ -21,6 +23,8 @@ public:
{
if (m_onResults)
m_onResults(m_results);
+ else
+ LOG(LERROR, ("OnResults is not set."));
}
inline Results const & GetResults() const { return m_results; }
@@ -29,6 +33,8 @@ public:
{
if (m_onResults)
m_onResults(Results::GetEndMarker(cancelled));
+ else
+ LOG(LERROR, ("OnResults is not set."));
}
private:
diff --git a/search/processor.cpp b/search/processor.cpp
index b3b27dff3c..81041dbf88 100644
--- a/search/processor.cpp
+++ b/search/processor.cpp
@@ -145,7 +145,7 @@ Processor::Processor(Index const & index, CategoriesHolder const & categories,
, m_minDistanceOnMapBetweenResults(0.0)
, m_mode(Mode::Everywhere)
, m_suggestsEnabled(true)
- , m_ranker(index, m_emitter, infoGetter, categories, suggests,
+ , m_ranker(index, infoGetter, m_emitter, categories, suggests,
static_cast<my::Cancellable const &>(*this))
, m_preRanker(index, m_ranker, kPreResultsCount)
, m_geocoder(index, infoGetter, m_preRanker, static_cast<my::Cancellable const &>(*this))
diff --git a/search/ranker.cpp b/search/ranker.cpp
index 57505d907a..7188d9f4f0 100644
--- a/search/ranker.cpp
+++ b/search/ranker.cpp
@@ -1,5 +1,6 @@
-#include "search/emitter.hpp"
#include "search/ranker.hpp"
+
+#include "search/emitter.hpp"
#include "search/string_intersection.hpp"
#include "search/token_slice.hpp"
#include "search/utils.hpp"
@@ -276,15 +277,15 @@ public:
// static
size_t const Ranker::kBatchSize = 10;
-Ranker::Ranker(Index const & index, Emitter & emitter,
- storage::CountryInfoGetter const & infoGetter, CategoriesHolder const & categories,
+Ranker::Ranker(Index const & index, storage::CountryInfoGetter const & infoGetter,
+ Emitter & emitter, CategoriesHolder const & categories,
vector<Suggest> const & suggests, my::Cancellable const & cancellable)
: m_reverseGeocoder(index)
, m_cancellable(cancellable)
, m_locality(index)
, m_index(index)
- , m_emitter(emitter)
, m_infoGetter(infoGetter)
+ , m_emitter(emitter)
, m_categories(categories)
, m_suggests(suggests)
{
diff --git a/search/ranker.hpp b/search/ranker.hpp
index 0792b7ff83..0226756c6d 100644
--- a/search/ranker.hpp
+++ b/search/ranker.hpp
@@ -67,7 +67,7 @@ public:
static size_t const kBatchSize;
- Ranker(Index const & index, Emitter & emitter, storage::CountryInfoGetter const & infoGetter,
+ Ranker(Index const & index, storage::CountryInfoGetter const & infoGetter, Emitter & emitter,
CategoriesHolder const & categories, vector<Suggest> const & suggests,
my::Cancellable const & cancellable);
virtual ~Ranker() = default;
@@ -130,8 +130,8 @@ private:
mutable LocalityFinder m_locality;
Index const & m_index;
- Emitter & m_emitter;
storage::CountryInfoGetter const & m_infoGetter;
+ Emitter & m_emitter;
CategoriesHolder const & m_categories;
vector<Suggest> const & m_suggests;
diff --git a/search/search_integration_tests/pre_ranker_test.cpp b/search/search_integration_tests/pre_ranker_test.cpp
index f54dd1cbb4..50094d1c4e 100644
--- a/search/search_integration_tests/pre_ranker_test.cpp
+++ b/search/search_integration_tests/pre_ranker_test.cpp
@@ -45,7 +45,7 @@ class TestRanker : public Ranker
public:
TestRanker(TestSearchEngine & engine, Emitter & emitter, vector<Suggest> const & suggests,
my::Cancellable const & cancellable, vector<PreResult1> & results)
- : Ranker(static_cast<Index const &>(engine), emitter, engine.GetCountryInfoGetter(),
+ : Ranker(static_cast<Index const &>(engine), engine.GetCountryInfoGetter(), emitter,
GetDefaultCategories(), suggests, cancellable)
, m_results(results)
{