Review fixes.

This commit is contained in:
vng 2015-06-11 15:57:12 +03:00 committed by Alex Zolotarev
parent 0f1406e1b7
commit 143a3b24a9
3 changed files with 15 additions and 6 deletions

View file

@ -9,12 +9,12 @@ namespace storage
bool ActiveMapsLayout::Item::IsEqual(TIndex const & index) const
{
return (find(m_index.begin(), m_index.end(), index) != m_index.end());
return (find(m_indexes.begin(), m_indexes.end(), index) != m_indexes.end());
}
bool ActiveMapsLayout::Item::IsEqual(Item const & item) const
{
for (TIndex const & i : m_index)
for (TIndex const & i : m_indexes)
if (item.IsEqual(i))
return true;
return false;

View file

@ -103,21 +103,28 @@ private:
class Item
{
buffer_vector<TIndex, 1> m_index;
/// Usually, this vector has size = 1 and sometimes = 2.
buffer_vector<TIndex, 1> m_indexes;
public:
template <class TCont> Item(TCont const & cont,
TStatus status,
TMapOptions options,
TMapOptions downloadRequest)
: m_index(cont.begin(), cont.end()), m_status(status),
: m_indexes(cont.begin(), cont.end()), m_status(status),
m_options(options), m_downloadRequest(downloadRequest)
{
ASSERT(!m_index.empty(), ());
ASSERT(!m_indexes.empty(), ());
}
/// Use this functions to compare Items by input TIndex.
//@{
bool IsEqual(TIndex const & index) const;
bool IsEqual(Item const & item) const;
TIndex const & Index() const { return m_index[0]; }
//@}
/// Get any key TIndex for the correspondent Item.
TIndex const & Index() const { return m_indexes[0]; }
TStatus m_status;
TMapOptions m_options;

View file

@ -119,6 +119,8 @@ namespace storage
Country const & CountryByIndex(TIndex const & index) const;
TIndex FindIndexByFile(string const & name) const;
/// @todo Temporary function to gel all associated indexes for the country file name.
/// Will be removed in future after refactoring.
vector<TIndex> FindAllIndexesByFile(string const & name) const;
void GetGroupAndCountry(TIndex const & index, string & group, string & country) const;