Welcome to mirror list, hosted at ThFree Co, Russian Federation.

feature_processor.hpp « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 00ad6f503e32075237a8ec5384c6f0155ac9bdf4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include "data_header.hpp"
#include "features_vector.hpp"

#include "../defines.hpp"

#include "../coding/file_reader.hpp"
#include "../coding/file_container.hpp"

#include "../std/bind.hpp"


namespace feature
{
  template <class ToDo>
  void ForEachFromDat(ModelReaderPtr reader, ToDo & toDo)
  {
    FilesContainerR container(reader);

    DataHeader header;
    header.Load(container.GetReader(HEADER_FILE_TAG));

    FeaturesVector featureSource(container, header);
    featureSource.ForEachOffset(bind<void>(ref(toDo), _1, _2));
  }

  template <class ToDo>
  void ForEachFromDat(string const & fPath, ToDo & toDo)
  {
    ForEachFromDat(new FileReader(fPath), toDo);
  }
}