/
githubmirror
/
omim
Обзор
Документация
Войти
/
githubmirror
/
omim
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
ugc/api.hpp
61 строка
2 KB
Arsentiy Milchakov
[ugc][statistics] check for zombie reviews
01 мар 2019, 18:28
01 мар 2019, 18:28
45d6ad8
Код
Авторство
О чём код?
#pragma once #include "ugc/loader.hpp" #include "ugc/storage.hpp" #include "ugc/types.hpp" #include "platform/safe_callback.hpp" #include "geometry/point2d.hpp" #include "base/thread_pool_delayed.hpp" #include <functional> class DataSource; struct FeatureID; namespace feature { class TypesHolder; } namespace ugc { class Api { public: using UGCCallback = platform::SafeCallback<void(UGC const & ugc, UGCUpdate const & update)>; using UGCCallbackUnsafe = std::function<void(UGC const & ugc, UGCUpdate const & update)>; using UGCJsonToSendCallback = std::function<void(std::string && jsonStr, size_t numberOfUnsynchronized)>; using OnResultCallback = platform::SafeCallback<void(Storage::SettingResult const result)>; using NumberOfUnsynchronizedCallback = std::function<void(size_t number)>; using HasUGCForPlaceCallback = platform::SafeCallback<void(bool result)>; Api(DataSource const & dataSource, NumberOfUnsynchronizedCallback const & callback); void GetUGC(FeatureID const & id, UGCCallbackUnsafe const & callback); void SetUGCUpdate(FeatureID const & id, UGCUpdate const & ugc, OnResultCallback const & callback = nullptr); void GetUGCToSend(UGCJsonToSendCallback const & callback); void HasUGCForPlace(uint32_t bestType, m2::PointD const & point, HasUGCForPlaceCallback const & callback); void SendingCompleted(); Loader & GetLoader(); void ValidateStorage(); private: void GetUGCImpl(FeatureID const & id, UGCCallbackUnsafe const & callback); Storage::SettingResult SetUGCUpdateImpl(FeatureID const & id, UGCUpdate const & ugc); void GetUGCToSendImpl(UGCJsonToSendCallback const & callback); void HasUGCForPlaceImpl(uint32_t bestType, m2::PointD const & point, HasUGCForPlaceCallback const & callback) const; void SendingCompletedImpl(); base::thread_pool::delayed::ThreadPool m_thread; Storage m_storage; Loader m_loader; }; } // namespace ugc