Go to the documentation of this file.
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)
136 #if UAVCAN_CPP_VERSION >= UAVCAN_CPP11
148 #endif // UAVCAN_NODE_TIMER_HPP_INCLUDED
MonotonicDuration getPeriod() const
MonotonicTime getDeadline() const
TimerEvent(MonotonicTime arg_scheduled_time, MonotonicTime arg_real_time)
MonotonicTime real_time
True time when the timer callback was invoked.
virtual void handleTimerEvent(const TimerEvent &event)
void setCallback(const Callback &callback)
MonotonicDuration period_
MonotonicTime scheduled_time
Time when the timer callback was expected to be invoked.
TimerEventForwarder(INode &node, const Callback &callback)
UAVCAN_EXPORT void handleFatalError(const char *msg)
const Callback & getCallback() const
TimerEventForwarder(INode &node)
TimerEventForwarder< std::function< void(const TimerEvent &event)> > Timer
Scheduler & getScheduler() const