diff options
author | vng <viktor.govako@gmail.com> | 2012-07-13 00:28:42 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:40:57 +0300 |
commit | 01857d535e997b23c901abfc1dbbf87e811b1e4f (patch) | |
tree | 75bc8d98205cf696112e49d23c8c3f903d4996be /indexer/mwm_set.cpp | |
parent | c360cb50628b4d031ff8b0637b22ec3e23bb96d5 (diff) |
Minor changes.
Diffstat (limited to 'indexer/mwm_set.cpp')
-rw-r--r-- | indexer/mwm_set.cpp | 17 |
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()); |