ScheduledCall TimedExecutor::CallAt(const TimePoint& at, std::function<void ()> fn) { unsigned id = GetCallId(); Add([this, id, at, fn]() { m_scheduledCalls.Insert(TimedExecutor::CallData(id, at, fn)); }); return MakeScheduledCall(id); }
ScheduledCall TimedExecutor::CallEvery(const Duration& interval, std::function<void ()> fn) { assert(interval > Duration::zero()); unsigned id = GetCallId(); Add([this, id, interval, fn]() { m_scheduledCalls.Insert(TimedExecutor::CallData(id, boost::chrono::steady_clock::now() + interval, interval, fn)); }); return MakeScheduledCall(id); }
char *DialogGetCallId(struct Dialog *dialog) { return GetCallId(dialog->id); }