#ifndef _WORKER_HPP_ #define _WORKER_HPP_ #ifndef ASIO_STANDALONE #define ASIO_STANDALONE #endif #include #include "timer.hpp" class Worker : public asio::io_context { }; class TimerdWorker : public Worker , public TimerService { public: std::weak_ptr AddTimer(const timer_callback& cb, uint32_t wait, uint32_t interval) { auto timer = std::make_shared(*this, cb, wait, interval); timer->Begin(); return std::weak_ptr(timer); } }; #endif