Files
comaps/search/categories_set.hpp
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

35 lines
698 B
C++

#pragma once
#include "indexer/classificator.hpp"
#include "indexer/search_string_utils.hpp"
#include "base/macros.hpp"
#include "base/string_utils.hpp"
#include <algorithm>
#include <cstdint>
#include <unordered_set>
namespace search
{
class CategoriesSet
{
public:
CategoriesSet() : m_classificator(classif()) {}
inline void Add(uint32_t type) { m_categories.insert(type); }
template <typename Fn>
void ForEach(Fn && fn) const
{
std::for_each(m_categories.begin(), m_categories.end(), std::forward<Fn>(fn));
}
private:
Classificator const & m_classificator;
std::unordered_set<uint32_t> m_categories;
DISALLOW_COPY_AND_MOVE(CategoriesSet);
};
} // namespace search