33 #ifndef EMANEUTILSTIMER_HEADER_ 34 #define EMANEUTILSTIMER_HEADER_ 92 template <
typename Function>
103 template <
typename Function>
109 using Callback = std::function<void(
TimerId,
114 using TimerInfo = std::tuple<TimerId,TimePoint,Duration,Callback,TimePoint>;
115 using TimePointMap = std::multimap<std::pair<TimePoint,TimerId>,TimerInfo>;
116 using TimerIdMap = std::map<TimerId,TimePoint>;
118 TimePointMap timePointMap_;
119 TimerIdMap timerIdMap_;
143 #endif // EMANEUTILSTIMER_HEADER_
A timer class that uses Linux interval timers.
TimerId schedule(Function fn, const TimePoint &absoluteTimePoint)
TimerId scheduleInterval(Function fn, const TimePoint &absoluteTimePoint, const Duration &interval)
Clock::time_point TimePoint
bool cancel(TimerId timerId)