31 g_source_remove(m_tag);
35 void start(
double nextFireInterval) {
36 guint delay = (guint)(nextFireInterval * 1000);
38 g_source_remove(m_tag);
39 m_tag = g_timeout_add(delay, [](gpointer data) -> gboolean {
43 return G_SOURCE_REMOVE;
47 bool isActive()
const {
56 TimerBase::TimerBase() : m_impl(nullptr) {
59 TimerBase::~TimerBase() {
63 void TimerBase::startOneShot(
double interval) {
66 m_impl->start(interval);
69 void TimerBase::stop() {
76 bool TimerBase::isActive()
const {
77 return m_impl && m_impl->isActive();