HLCC Documentation 2.2.0
Loading...
Searching...
No Matches
logTimer.hpp
Go to the documentation of this file.
1
11#ifndef HLCC_COMMON_UTILS_LOGTIMER_HPP
12#define HLCC_COMMON_UTILS_LOGTIMER_HPP
13
14#include <functional>
15#include <boost/asio.hpp>
16#include <chrono>
17#include <optional>
18
43 public:
50 LogTimer(uint32_t period_s);
51
58 std::optional<uint32_t> check();
59
60 private:
61 void tick_();
62 boost::asio::chrono::seconds m_period_s;
63 uint32_t m_skipped_count;
64 boost::asio::io_context m_io;
65 boost::asio::steady_timer m_timer;
66
67 // Always log message for the first time
68 bool m_ready = true;
69};
70
71#endif // HLCC_COMMON_UTILS_LOGTIMER_HPP
Definition logTimer.hpp:42
LogTimer(uint32_t period_s)
Definition logTimer.cpp:14
std::optional< uint32_t > check()
Definition logTimer.cpp:21