diff options
author | vng <viktor.govako@gmail.com> | 2011-08-23 18:17:58 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:22:20 +0300 |
commit | 2046a47d565e7f3c9a1a18eaec7d969f9bf20789 (patch) | |
tree | 504aa14d86e0296c78bb377e1d0d3badabd991ef /indexer/feature_processor.hpp | |
parent | 56dda155545598d52fd21d406015468f376c3f88 (diff) |
Factor out FeatureBuilder to the separate module in 'generator' lib.
Diffstat (limited to 'indexer/feature_processor.hpp')
-rw-r--r-- | indexer/feature_processor.hpp | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/indexer/feature_processor.hpp b/indexer/feature_processor.hpp index c471d73583..f3bdf5d662 100644 --- a/indexer/feature_processor.hpp +++ b/indexer/feature_processor.hpp @@ -23,34 +23,4 @@ namespace feature { ForEachFromDat(new FileReader(fPath), toDo); } - - /// Read feature from feature source. - template <class TSource> - void ReadFromSourceRowFormat(TSource & src, FeatureBuilder1 & f) - { - uint32_t const sz = ReadVarUint<uint32_t>(src); - typename FeatureBuilder1::buffer_t buffer(sz); - src.Read(&buffer[0], sz); - f.Deserialize(buffer); - } - - /// Process features in .dat file. - template <class ToDo> - void ForEachFromDatRawFormat(string const & fName, ToDo & toDo) - { - FileReader reader(fName); - ReaderSource<FileReader> src(reader); - - uint64_t currPos = 0; - uint64_t const fSize = reader.Size(); - - // read features one by one - while (currPos < fSize) - { - FeatureBuilder1 f; - ReadFromSourceRowFormat(src, f); - toDo(f, currPos); - currPos = src.Pos(); - } - } } |