diff options
author | vng <viktor.govako@gmail.com> | 2011-01-02 23:25:06 +0300 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:09:04 +0300 |
commit | d9133a2d9fd2445033d1e16b5e9c625ebd80b494 (patch) | |
tree | d99ea74eb439a89197b5a6399a1ac06143459d3a /map/feature_vec_model.cpp | |
parent | b33ae08c7968744e969f9e75dcd0e8bd7a58f400 (diff) |
Add files container everywere for dat, geom, trg, idx.
Diffstat (limited to 'map/feature_vec_model.cpp')
-rw-r--r-- | map/feature_vec_model.cpp | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/map/feature_vec_model.cpp b/map/feature_vec_model.cpp index f085d2f9c3..4034504494 100644 --- a/map/feature_vec_model.cpp +++ b/map/feature_vec_model.cpp @@ -8,7 +8,8 @@ #include "../indexer/scales.hpp" #include "../indexer/classif_routine.hpp" #include "../indexer/classificator.hpp" -#include "../indexer/data_header_reader.hpp" + +#include "../coding/file_container.hpp" #include "../base/logging.hpp" @@ -27,31 +28,18 @@ void FeaturesFetcher::InitClassificator() p.ReadPathForFile("visibility.txt")); } -void FeaturesFetcher::AddMap(string const & dataPath, string const & indexPath) +void FeaturesFetcher::AddMap(string const & fName) { - if (m_multiIndex.IsExist(dataPath)) + if (m_multiIndex.IsExist(fName)) return; try { - uint32_t const datLogPageSize = 10; - uint32_t const datLogPageCount = 11; - - uint32_t const idxLogPageSize = 8; - uint32_t const idxLogPageCount = 11; - - FileReader dataReader(dataPath, datLogPageSize, datLogPageCount); - uint64_t const startOffset = feature::GetSkipHeaderSize(dataReader); + uint32_t const logPageSize = 12; + uint32_t const logPageCount = 12; -#ifdef USE_BUFFER_READER - // readers from memory - m_multiIndex.Add(BufferReader(dataReader, startOffset), BufferReader(FileReader(indexPath))); -#else - // readers from file - m_multiIndex.Add( - dataReader.SubReader(startOffset, dataReader.Size() - startOffset), - FileReader(indexPath, idxLogPageSize, idxLogPageCount)); -#endif + FilesContainerR container(fName, logPageSize, logPageCount); + m_multiIndex.Add(FeatureReaders<FileReader>(container), container.GetReader(INDEX_FILE_TAG)); } catch (Reader::OpenException const & e) { @@ -63,9 +51,9 @@ void FeaturesFetcher::AddMap(string const & dataPath, string const & indexPath) } } -void FeaturesFetcher::RemoveMap(string const & dataPath) +void FeaturesFetcher::RemoveMap(string const & fName) { - m_multiIndex.Remove(dataPath); + m_multiIndex.Remove(fName); } void FeaturesFetcher::Clean() |