#pragma once #include "drape_frontend/threads_commutator.hpp" #include "drape/pointers.hpp" #include "base/worker_thread.hpp" #include #include #include namespace df { class DrapeNotifier { public: static uint64_t constexpr kInvalidId = 0; using Functor = std::function; explicit DrapeNotifier(ref_ptr commutator); uint64_t Notify(ThreadsCommutator::ThreadName threadName, base::WorkerThread::Duration const & duration, bool repeating, Functor && functor); private: void NotifyImpl(ThreadsCommutator::ThreadName threadName, base::WorkerThread::Duration const & duration, bool repeating, uint64_t notifyId, Functor && functor); ref_ptr m_commutator; std::atomic m_counter; }; } // namespace df