1#ifndef MANUAL_RUNTIME_HPP_IPFSK6ZA
2#define MANUAL_RUNTIME_HPP_IPFSK6ZA
4#include <vanetza/common/runtime.hpp>
5#include <boost/multi_index_container.hpp>
6#include <boost/multi_index/hashed_index.hpp>
7#include <boost/multi_index/member.hpp>
8#include <boost/multi_index/ordered_index.hpp>
34 void trigger(Clock::time_point tp);
42 void trigger(Clock::duration d);
50 void reset(Clock::time_point tp);
57 Clock::time_point
next()
const;
60 void schedule(Clock::time_point,
const Callback&,
const void* =
nullptr)
override;
61 void schedule(Clock::duration,
const Callback&,
const void* =
nullptr)
override;
62 void cancel(
const void* scope)
override;
63 Clock::time_point
now()
const override;
69 deadline(tp), callback(cb), scope(scope) {}
77 Clock::time_point deadline;
83 using time_index = boost::multi_index::ordered_non_unique<
84 boost::multi_index::tag<by_deadline>,
85 boost::multi_index::member<ScheduledCallback, Clock::time_point, &ScheduledCallback::deadline>>;
87 using scope_index = boost::multi_index::hashed_non_unique<
88 boost::multi_index::tag<by_scope>,
89 boost::multi_index::member<ScheduledCallback, const void*, &ScheduledCallback::scope>>;
91 boost::multi_index::indexed_by<time_index, scope_index>>;
95 Clock::time_point m_now;
void trigger(Clock::time_point tp)
void cancel(const void *scope) override
Clock::time_point next() const
void reset(Clock::time_point tp)
Clock::time_point now() const override
void schedule(Clock::time_point, const Callback &, const void *=nullptr) override