diff options
author | vng <viktor.govako@gmail.com> | 2015-06-10 19:09:58 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 02:51:13 +0300 |
commit | 0f1406e1b7d44f09fc96cd9e50c21cefd2fac788 (patch) | |
tree | c9b39cb4970852ca0466dce617a25d2ddd176985 /map/active_maps_layout.hpp | |
parent | 163d3a7734d6d189d9c01b07809cb01443dd17d1 (diff) |
[downloader] Fixed case when country item has many storage::TIndex values.
Diffstat (limited to 'map/active_maps_layout.hpp')
-rw-r--r-- | map/active_maps_layout.hpp | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/map/active_maps_layout.hpp b/map/active_maps_layout.hpp index 5bb843ca12..3c55568577 100644 --- a/map/active_maps_layout.hpp +++ b/map/active_maps_layout.hpp @@ -3,6 +3,8 @@ #include "storage/storage_defines.hpp" #include "storage/index.hpp" +#include "base/buffer_vector.hpp" + #include "std/string.hpp" #include "std/vector.hpp" #include "std/map.hpp" @@ -96,14 +98,27 @@ private: void ShowMap(TIndex const & index); -private: void StatusChangedCallback(TIndex const & index); void ProgressChangedCallback(TIndex const & index, LocalAndRemoteSizeT const & sizes); -private: - struct Item + class Item { - TIndex m_index; + buffer_vector<TIndex, 1> m_index; + public: + template <class TCont> Item(TCont const & cont, + TStatus status, + TMapOptions options, + TMapOptions downloadRequest) + : m_index(cont.begin(), cont.end()), m_status(status), + m_options(options), m_downloadRequest(downloadRequest) + { + ASSERT(!m_index.empty(), ()); + } + + bool IsEqual(TIndex const & index) const; + bool IsEqual(Item const & item) const; + TIndex const & Index() const { return m_index[0]; } + TStatus m_status; TMapOptions m_options; TMapOptions m_downloadRequest; @@ -116,7 +131,6 @@ private: Item const * FindItem(TIndex const & index) const; bool GetGroupAndPositionByIndex(TIndex const & index, TGroup & group, int & position); -private: int InsertInGroup(TGroup const & group, Item const & item); void DeleteFromGroup(TGroup const & group, int position); int MoveItemToGroup(TGroup const & group, int position, TGroup const & newGroup); |