HLCC Documentation 2.2.0
Loading...
Searching...
No Matches
heartbeatTimer.hpp
Go to the documentation of this file.
1
11#ifndef HLCC_COMMON_UTILS_HEARTBEATTIMER_HPP
12#define HLCC_COMMON_UTILS_HEARTBEATTIMER_HPP
13
14#include <functional>
15#include <boost/asio.hpp>
16#include <chrono>
18 public:
19 using handle = std::function<void()>;
20
21 HeartbeatTimer(int time, handle f);
22 void poll();
23
24 private:
25 void tick_(handle f);
26 boost::asio::chrono::seconds m_time;
27 boost::asio::io_context m_io;
28 boost::asio::steady_timer m_timer;
29
30};
31#endif// HLCC_COMMON_UTILS_HEARTBEATTIMER_HPP
Definition heartbeatTimer.hpp:17
std::function< void()> handle
Definition heartbeatTimer.hpp:19
HeartbeatTimer(int time, handle f)
Definition heartbeatTimer.cpp:14
void poll()
Definition heartbeatTimer.cpp:20