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

data_factory.cpp « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f1edc82c0e084c01aaf96a1834853251fc82d38 (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
#include "indexer/data_factory.hpp"
#include "indexer/interval_index.hpp"
#include "indexer/old/interval_index_101.hpp"

#include "coding/file_container.hpp"

#include "defines.hpp"


void IndexFactory::Load(FilesContainerR const & cont)
{
  ReadVersion(cont, m_version);
  m_header.Load(cont);

  if (cont.IsExist(REGION_INFO_FILE_TAG))
  {
    ReaderSource<FilesContainerR::TReader> src(cont.GetReader(REGION_INFO_FILE_TAG));
    m_regionData.Deserialize(src);
  }
}

IntervalIndexIFace * IndexFactory::CreateIndex(ModelReaderPtr reader) const
{
  if (m_version.GetFormat() == version::Format::v1)
    return new old_101::IntervalIndex<uint32_t, ModelReaderPtr>(reader);
  return new IntervalIndex<ModelReaderPtr>(reader);
}