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

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Gorshenin <y@maps.me>2017-02-21 12:45:10 +0300
committerYuri Gorshenin <y@maps.me>2017-02-21 12:45:10 +0300
commit8f2e48941c7937c03957ca7ef6f1bb669f59a0be (patch)
treeb440d026857ebddc1e8d86ac799a29f4927484e0 /indexer/ftypes_matcher.hpp
parent009388f72e98d9eee5a3a2d44e734fcec2f68a7d (diff)
[search] Added filtering by hotel type.
Diffstat (limited to 'indexer/ftypes_matcher.hpp')
-rw-r--r--indexer/ftypes_matcher.hpp31
1 files changed, 28 insertions, 3 deletions
diff --git a/indexer/ftypes_matcher.hpp b/indexer/ftypes_matcher.hpp
index 760d391120..dc0da449a7 100644
--- a/indexer/ftypes_matcher.hpp
+++ b/indexer/ftypes_matcher.hpp
@@ -3,7 +3,9 @@
#include "base/base.hpp"
#include "std/algorithm.hpp"
+#include "std/array.hpp"
#include "std/initializer_list.hpp"
+#include "std/limits.hpp"
#include "std/string.hpp"
#include "std/utility.hpp"
#include "std/vector.hpp"
@@ -160,11 +162,34 @@ public:
class IsHotelChecker : public BaseChecker
{
- IsHotelChecker();
-
public:
+ enum class Type
+ {
+ Hotel,
+ Apartment,
+ CampSite,
+ Chalet,
+ GuestHouse,
+ Hostel,
+ Motel,
+ Resort,
+
+ Count
+ };
+
+ static_assert(static_cast<size_t>(Type::Count) <= CHAR_BIT * sizeof(unsigned),
+ "Too many types of hotels");
+
static IsHotelChecker const & Instance();
- static vector<string> const & GetHotelTags();
+
+ static char const * const GetHotelTypeTag(Type type);
+
+ unsigned GetHotelTypesMask(FeatureType const & ft) const;
+
+private:
+ IsHotelChecker();
+
+ array<pair<uint32_t, Type>, static_cast<size_t>(Type::Count)> m_sortedTypes;
};
// WiFi is a type in classificator.txt,