1#include <vanetza/common/runtime.hpp>
2#include <vanetza/geonet/dcc_information_sharing.hpp>
3#include <vanetza/geonet/location_table.hpp>
11 m_runtime(rt), m_location_table(lt), m_cbr_target(target),
12 m_trigger_interval(
std::chrono::milliseconds(100)),
13 m_last_aggregation(m_runtime.now()),
14 on_global_cbr_update(m_update_hook)
16 Clock::duration initial = m_trigger_interval;
17 initial *= delay.value();
18 m_runtime.
schedule(initial, [
this](
const Clock::time_point&) { trigger(); });
26DccField DccInformationSharing::generate_dcc_field()
37 m_cbr_local = local_cbr;
40void DccInformationSharing::trigger()
42 m_aggregator.
aggregate(m_cbr_local, m_location_table, m_last_aggregation, m_cbr_target);
43 m_last_aggregation = m_runtime.
now();
44 m_update_hook(
static_cast<const CbrAggregator&
>(m_aggregator));
45 m_runtime.
schedule(m_trigger_interval, [
this](
const Clock::time_point&) { trigger(); });
virtual Clock::time_point now() const =0
virtual void schedule(Clock::time_point tp, const Callback &cb, const void *scope=nullptr)=0
ChannelLoad get_local_cbr() const
void aggregate(ChannelLoad cbr_local, const LocationTable <, Timestamp cbr_lifetime, ChannelLoad cbr_target)
ChannelLoad get_one_hop_cbr() const