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

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

#include "std/vector.hpp"
#include "std/map.hpp"
#include "std/iostream.hpp"


class IndexAndTypeMapping
{
  vector<uint32_t> m_types;

  typedef map<uint32_t, uint32_t> MapT;
  MapT m_map;

  void Add(uint32_t ind, uint32_t type);

public:
  void Clear();
  void Load(istream & s);

  uint32_t GetType(uint32_t ind) const
  {
    ASSERT_LESS ( ind, m_types.size(), () );
    return m_types[ind];
  }

  uint32_t GetIndex(uint32_t t) const;

  /// For Debug purposes only.
  bool HasIndex(uint32_t t) const { return (m_map.find(t) != m_map.end()); }
};