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

data_header.cpp « storage - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 4b3805b2c71ca94d6547b87a09cff5795aef9c20 (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
43
44
45
46
47
#include "data_header.hpp"

#include "../base/string_utils.hpp"

#include "../platform/platform.hpp"

#include "../coding/file_writer.hpp"

#include "../indexer/cell_id.hpp"

#include "../base/start_mem_debug.hpp"

namespace feature
{

  DataHeader::DataHeader()
  {
    Reset();
  }

  namespace
  {
    struct do_reset
    {
      void operator() (string & t, int) { t.clear(); }
      void operator() (uint64_t & t, int) { t = 0; }
      void operator() (pair<int64_t, int64_t> &, int) {}
    };
  }

  void DataHeader::Reset()
  {
    do_reset doReset;
    for_each_tuple(m_params, doReset);
  }

  m2::RectD const DataHeader::Bounds() const
  {
    return Int64ToRect(Get<EBoundary>());
  }

  void DataHeader::SetBounds(m2::RectD const & r)
  {
    Set<EBoundary>(RectToInt64(r));
  }

}