/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
map/notifications/notification_manager.hpp
61 строка
1 KB
Evgeniy A. Dushistov
[map] remove last usage of boost::optional
21 сен 2020, 15:24
21 сен 2020, 15:24
8251833
Код
Авторство
О чём код?
#pragma once #include "map/notifications/notification_queue.hpp" #include "storage/storage_defines.hpp" #include "metrics/eye.hpp" #include <ctime> #include <memory> #include <optional> #include <string> #include <unordered_set> namespace ugc { class Api; } namespace notifications { using Notification = std::optional<NotificationCandidate>; class NotificationManager : public eye::Subscriber { public: friend class NotificationManagerForTesting; class Delegate { public: virtual ~Delegate() = default; virtual ugc::Api & GetUGCApi() = 0; virtual std::unordered_set<storage::CountryId> GetDescendantCountries( storage::CountryId const & country) const = 0; virtual storage::CountryId GetCountryAtPoint(m2::PointD const & pt) const = 0; virtual std::string GetAddress(m2::PointD const & pt) = 0; }; void SetDelegate(std::unique_ptr<Delegate> delegate); void Load(); void TrimExpired(); Notification GetNotification(); size_t GetCandidatesCount() const; void DeleteCandidatesForCountry(storage::CountryId const & countryId); // eye::Subscriber overrides: void OnMapObjectEvent(eye::MapObject const & poi) override; private: bool Save(); void ProcessUgcRateCandidates(eye::MapObject const & poi); Candidates::iterator GetUgcRateCandidate(); std::unique_ptr<Delegate> m_delegate; // Notification candidates queue. Queue m_queue; }; } // namespace notifications