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

altitude_loader.hpp « indexer - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ea74f2a877cbe9955fd9a1ee2e974ede39ecf859 (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
42
#pragma once
#include "indexer/feature_altitude.hpp"
#include "indexer/index.hpp"
#include "indexer/mwm_set.hpp"

#include "coding/memory_region.hpp"

#include "std/string.hpp"
#include "std/unique_ptr.hpp"
#include "std/vector.hpp"

#include "3party/succinct/rs_bit_vector.hpp"

namespace feature
{
class AltitudeLoader
{
public:
  AltitudeLoader(Index const & index, MwmSet::MwmId const & mwmId);

  /// \returns altitude of feature with |featureId|. All items of the returned vector are valid
  /// or the returned vector is empty.
  TAltitudes const & GetAltitudes(uint32_t featureId, size_t pointCount);

  bool HasAltitudes() const;

  void ClearCache() { m_cache.clear(); }

private:
  unique_ptr<CopiedMemoryRegion> m_altitudeAvailabilityRegion;
  unique_ptr<CopiedMemoryRegion> m_featureTableRegion;

  succinct::rs_bit_vector m_altitudeAvailability;
  succinct::elias_fano m_featureTable;

  unique_ptr<FilesContainerR::TReader> m_reader;
  map<uint32_t, TAltitudes> m_cache;
  AltitudeHeader m_header;
  string m_countryFileName;
  MwmSet::MwmHandle m_handle;
};
}  // namespace feature