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:
Diffstat (limited to 'indexer/mwm_set.cpp')
-rw-r--r--indexer/mwm_set.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/indexer/mwm_set.cpp b/indexer/mwm_set.cpp
index dec88bf5df..32dc71e1d8 100644
--- a/indexer/mwm_set.cpp
+++ b/indexer/mwm_set.cpp
@@ -1,4 +1,5 @@
#include "mwm_set.hpp"
+#include "scales.hpp"
#include "../../defines.hpp"
@@ -16,6 +17,15 @@ MwmInfo::MwmInfo() : m_lockCount(0), m_status(STATUS_REMOVED)
// Apply STATUS_ACTIVE before adding to maps container.
}
+MwmInfo::MwmTypeT MwmInfo::GetType() const
+{
+ if (m_minScale > 0) return COUNTRY;
+ if (m_maxScale == scales::GetUpperWorldScale()) return WORLD;
+ ASSERT_EQUAL(m_maxScale, scales::GetUpperScale(), ());
+ return COASTS;
+}
+
+
MwmSet::MwmLock::MwmLock(MwmSet & mwmSet, MwmId mwmId)
: m_mwmSet(mwmSet), m_id(mwmId), m_pValue(mwmSet.LockValue(mwmId))
{
@@ -170,16 +180,13 @@ bool MwmSet::RemoveImpl(string const & fileName)
return ret;
}
-void MwmSet::RemoveAllCountries()
+void MwmSet::RemoveAll()
{
threads::MutexGuard mutexGuard(m_lock);
UNUSED_VALUE(mutexGuard);
for (MwmId i = 0; i < m_info.size(); ++i)
- {
- if (m_info[i].IsCountry())
- (void)RemoveImpl(i);
- }
+ (void)RemoveImpl(i);
// do not call ClearCache - it's under mutex lock
ClearCacheImpl(m_cache.begin(), m_cache.end());