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

lazy_centers_table.hpp « search - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 53dffbeb95468f65a2a570eb94050ba696a9da83 (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
34
35
36
37
38
39
40
41
#pragma once

#include "indexer/centers_table.hpp"

#include "coding/files_container.hpp"

#include "geometry/point2d.hpp"

#include <cstdint>
#include <memory>

class MwmValue;

namespace search
{
class LazyCentersTable
{
public:
  enum State
  {
    STATE_NOT_LOADED,
    STATE_LOADED,
    STATE_FAILED
  };

  explicit LazyCentersTable(MwmValue const & value);

  inline State GetState() const { return m_state; }

  void EnsureTableLoaded();

  WARN_UNUSED_RESULT bool Get(uint32_t id, m2::PointD & center);

private:
  MwmValue const & m_value;
  State m_state;

  FilesContainerR::TReader m_reader;
  std::unique_ptr<CentersTable> m_table;
};
}  // namespace search