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

taxi_places.hpp « partners_api - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5b2503047c0fd558b988869c6bdfe6d74f96c72f (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
48
49
#pragma once

#include "storage/storage_defines.hpp"

#include "coding/serdes_json.hpp"

#include "base/visitor.hpp"

#include <string>
#include <unordered_set>
#include <vector>

namespace taxi
{
class Places
{
public:
  friend class PlacesTest;

  struct Country
  {
    storage::CountryId m_id;
    std::vector<std::string> m_cities;

    DECLARE_VISITOR_AND_DEBUG_PRINT(Country, visitor(m_id, "id"), visitor(m_cities, "cities"))
  };

  bool IsCountriesEmpty() const;
  bool IsMwmsEmpty() const;
  bool Has(storage::CountryId const & id, std::string const & city) const;
  bool Has(storage::CountryId const & mwmId) const;

  DECLARE_VISITOR_AND_DEBUG_PRINT(Places, visitor(m_countries, "countries"),
                                  visitor(m_mwmIds, "mwms"))

private:
  std::vector<Country> m_countries;
  std::unordered_set<storage::CountryId> m_mwmIds;
};

struct SupportedPlaces
{
  Places m_enabledPlaces;
  Places m_disabledPlaces;

  DECLARE_VISITOR_AND_DEBUG_PRINT(SupportedPlaces, visitor(m_enabledPlaces, "enabled"),
                                  visitor(m_disabledPlaces, "disabled"))
};
}  // namespace taxi