Files
comaps/drape_frontend/drape_notifier.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

36 lines
910 B
C++

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