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:
authorYury Melnichek <melnichek@gmail.com>2011-09-22 23:38:52 +0400
committerAlex Zolotarev <alex@maps.me>2015-09-23 01:24:18 +0300
commit7096a9d438d8247949171b664b20965b80d08bc1 (patch)
treea7ca90bed2724532e025222ad2eed6fae0fb5033 /indexer/index.hpp
parentf7bf36f540f5dfe1e4675e166a44eb5bc9a82a13 (diff)
Introduce MwmValueBase.
Diffstat (limited to 'indexer/index.hpp')
-rw-r--r--indexer/index.hpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/indexer/index.hpp b/indexer/index.hpp
index ea76c8d07b..ebb13eb5d7 100644
--- a/indexer/index.hpp
+++ b/indexer/index.hpp
@@ -14,7 +14,7 @@
#include "../std/vector.hpp"
-class MwmValue
+class MwmValue : public MwmSet::MwmValueBase
{
public:
FilesContainerR m_cont;
@@ -29,12 +29,22 @@ class Index : public MwmSet
protected:
virtual void GetInfo(string const & name, MwmInfo & info) const;
virtual MwmValue * CreateValue(string const & name) const;
- virtual void DestroyValue(MwmValue *) const;
public:
Index();
~Index();
+ class MwmLock : public MwmSet::MwmLock
+ {
+ public:
+ MwmLock(Index const & index, MwmId mwmId) : MwmSet::MwmLock(index, mwmId) {}
+
+ inline MwmValue * GetValue() const
+ {
+ return static_cast<MwmValue *>(MwmSet::MwmLock::GetValue());
+ }
+ };
+
template <typename F>
void ForEachInRect(F & f, m2::RectD const & rect, uint32_t scale) const
{
@@ -99,7 +109,8 @@ private:
if (pValue)
{
FeaturesVector fv(pValue->m_cont, pValue->GetHeader());
- ScaleIndex<ModelReaderPtr> index(pValue->m_cont.GetReader(INDEX_FILE_TAG), pValue->m_factory);
+ ScaleIndex<ModelReaderPtr> index(pValue->m_cont.GetReader(INDEX_FILE_TAG),
+ pValue->m_factory);
unordered_set<uint32_t> offsets;
ReadFeatureFunctor<F> f1(fv, f, offsets);