29 explicit Impl (std::function<
void()> cb)
30 : callback (std::move (cb)) {}
34 const ScopedLock lock (mutex);
42 const ScopedLock lock (mutex);
56 const ScopedLock lock (mutex);
62 const ScopedLock lock (mutex);
66 void messageCallback()
override
68 const ScopedLock lock (mutex);
70 if (std::exchange (deliver,
false))
71 NullCheckedInvocation::invoke (callback);
75 CriticalSection mutex;
76 std::function<void()> callback;
82 : impl (new Impl (std::move (callbackToUse))) {}
85 : impl (std::exchange (other.impl,
nullptr)) {}
90 std::swap (temp.impl, impl);
119 impl->messageCallback();
127 return impl->isPending();
bool isUpdatePending() const noexcept
void triggerAsyncUpdate()
LockingAsyncUpdater & operator=(LockingAsyncUpdater &&other) noexcept
void cancelPendingUpdate() noexcept
void handleUpdateNowIfNeeded()
LockingAsyncUpdater(std::function< void()> callbackToUse)