5 #ifndef UAVCAN_NODE_TIMER_HPP_INCLUDED 6 #define UAVCAN_NODE_TIMER_HPP_INCLUDED 16 #if !defined(UAVCAN_CPP11) || !defined(UAVCAN_CPP_VERSION) 17 # error UAVCAN_CPP_VERSION 20 #if UAVCAN_CPP_VERSION >= UAVCAN_CPP11 21 # include <functional> 38 : scheduled_time(arg_scheduled_time)
39 , real_time(arg_real_time)
82 virtual void handleTimerEvent(
const TimerEvent& event) = 0;
95 template <
typename Callback_>
106 if (coerceOrFallback<bool>(callback_,
true))
124 , callback_(callback)
132 void setCallback(
const Callback& callback) { callback_ = callback; }
136 #if UAVCAN_CPP_VERSION >= UAVCAN_CPP11 148 #endif // UAVCAN_NODE_TIMER_HPP_INCLUDED
const Callback & getCallback() const
TimerEventForwarder(INode &node)
MonotonicTime scheduled_time
Time when the timer callback was expected to be invoked.
UAVCAN_EXPORT void handleFatalError(const char *msg)
Scheduler & getScheduler() const
void setCallback(const Callback &callback)
TimerEvent(MonotonicTime arg_scheduled_time, MonotonicTime arg_real_time)
TimerEventForwarder< std::function< void(const TimerEvent &event)> > Timer
virtual void handleTimerEvent(const TimerEvent &event)
MonotonicTime getDeadline() const
MonotonicTime real_time
True time when the timer callback was invoked.
MonotonicDuration period_
TimerEventForwarder(INode &node, const Callback &callback)
MonotonicDuration getPeriod() const