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

index_builder.hpp « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: edd9e5c45d2ccdcecb8efe894ee67cd6a9a385cc (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
#pragma once

#include "scale_index_builder.hpp"

namespace indexer
{
  template <class FeaturesVectorT, typename WriterT>
  void BuildIndex(uint32_t bucketsCount,
                  int codingScale,
                  FeaturesVectorT const & featuresVector,
                  WriterT & writer,
                  string const & tmpFilePrefix)
  {
    LOG(LINFO, ("Building scale index."));
    uint64_t indexSize;
    {
      SubWriter<WriterT> subWriter(writer);
      IndexScales(bucketsCount, codingScale, featuresVector, subWriter, tmpFilePrefix);
      indexSize = subWriter.Size();
    }
    LOG(LINFO, ("Built scale index. Size =", indexSize));
  }

  // doesn't throw exceptions
  bool BuildIndexFromDatFile(string const & datFile, string const & tmpFile);
}