Add some functions for search result's interface.
This commit is contained in:
parent
f2e87171b3
commit
738d0aed2c
2 changed files with 14 additions and 3 deletions
|
@ -67,7 +67,18 @@ public:
|
|||
inline IterT Begin() const { return m_vec.begin(); }
|
||||
inline IterT End() const { return m_vec.end(); }
|
||||
|
||||
inline size_t Count() const { return m_vec.size(); }
|
||||
inline size_t GetCount() const { return m_vec.size(); }
|
||||
|
||||
inline Result const & GetResult(size_t i) const
|
||||
{
|
||||
ASSERT_LESS(i, m_vec.size(), ());
|
||||
return m_vec[i];
|
||||
}
|
||||
|
||||
inline void Swap(Results & rhs)
|
||||
{
|
||||
m_vec.swap(rhs.m_vec);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -235,7 +235,7 @@ void Engine::SearchAsync()
|
|||
res.Clear();
|
||||
m_pQuery->SearchAllInViewport(GetViewportRect(params.m_lat, params.m_lon, arrR[i]), res, 3*RESULTS_COUNT);
|
||||
|
||||
if (m_pQuery->IsCanceled() || res.Count() >= 2*RESULTS_COUNT)
|
||||
if (m_pQuery->IsCanceled() || res.GetCount() >= 2*RESULTS_COUNT)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -251,7 +251,7 @@ void Engine::SearchAsync()
|
|||
params.m_callback(res);
|
||||
|
||||
// Make additional search in whole mwm when not enough results.
|
||||
if (!m_pQuery->IsCanceled() && res.Count() < RESULTS_COUNT)
|
||||
if (!m_pQuery->IsCanceled() && res.GetCount() < RESULTS_COUNT)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
|
Reference in a new issue