#include <flow_control.hpp>
Classes | |
| struct | PendingTransmission |
Public Types | |
| using | PacketDropHook = Hook<access::AccessCategory, const ChunkPacket*> |
| using | PacketTransmitHook = Hook<access::AccessCategory, const ChunkPacket*> |
Public Member Functions | |
| FlowControl (Runtime &, TransmitRateControl &, access::Interface &) | |
| void | request (const DataRequest &, std::unique_ptr< ChunkPacket >) override |
| void | set_packet_drop_hook (PacketDropHook::callback_type &&) |
| void | set_packet_transmit_hook (PacketTransmitHook::callback_type &&) |
| void | queue_length (std::size_t length) |
| void | reschedule () |
Private Types | |
| using | Queue = std::list<PendingTransmission> |
Private Member Functions | |
| void | enqueue (const DataRequest &, std::unique_ptr< ChunkPacket >) |
| boost::optional< PendingTransmission > | dequeue () |
| void | transmit (const DataRequest &, std::unique_ptr< ChunkPacket >) |
| bool | transmit_immediately (const Transmission &) const |
| void | drop_expired () |
| bool | empty () const |
| void | trigger () |
| void | schedule_trigger (const Transmission &) |
| PendingTransmission * | next_transmission () |
| Queue * | next_queue () |
Private Attributes | |
| Runtime & | m_runtime |
| TransmitRateControl & | m_trc |
| access::Interface & | m_access |
| std::map< access::AccessCategory, Queue, std::greater< access::AccessCategory > > | m_queues |
| std::size_t | m_queue_length |
| PacketDropHook | m_packet_drop_hook |
| PacketTransmitHook | m_packet_transmit_hook |
FlowControl is a gatekeeper above access layer.
There is a queue for each access category. Packets might be enqueued because of exceeded transmission intervals determined by Scheduler. If a packet's lifetime expires before transmission it will be dropped.
Definition at line 37 of file flow_control.hpp.
| using vanetza::dcc::FlowControl::PacketDropHook = Hook<access::AccessCategory, const ChunkPacket*> |
Definition at line 40 of file flow_control.hpp.
| using vanetza::dcc::FlowControl::PacketTransmitHook = Hook<access::AccessCategory, const ChunkPacket*> |
Definition at line 41 of file flow_control.hpp.
|
private |
Definition at line 100 of file flow_control.hpp.
| vanetza::dcc::FlowControl::FlowControl | ( | Runtime & | runtime, |
| TransmitRateControl & | trc, | ||
| access::Interface & | ifc ) |
Create FlowControl instance
| rt | Runtime used for timed actions, e.g. packet expiry |
| scheduler | Scheduler providing transmission intervals |
| access | Interface to access layer |
Definition at line 15 of file flow_control.cpp.
| vanetza::dcc::FlowControl::~FlowControl | ( | ) |
Definition at line 20 of file flow_control.cpp.
|
private |
Definition at line 75 of file flow_control.cpp.
|
private |
Definition at line 135 of file flow_control.cpp.
|
private |
Definition at line 103 of file flow_control.cpp.
|
private |
Definition at line 59 of file flow_control.cpp.
|
private |
Definition at line 111 of file flow_control.cpp.
|
private |
Definition at line 129 of file flow_control.cpp.
| void vanetza::dcc::FlowControl::queue_length | ( | std::size_t | length | ) |
Set length of each queue
The first queue element is dropped when the length limit is hit.
| length | Maximum number of queue elements, 0 for unlimited length |
Definition at line 172 of file flow_control.cpp.
|
overridevirtual |
Request packet transmission
| request | DCC request parameters |
| packet | Packet data |
Implements vanetza::dcc::RequestInterface.
Definition at line 25 of file flow_control.cpp.
| void vanetza::dcc::FlowControl::reschedule | ( | ) |
Reschedule queued transmissions This reevaluates TRC restrictions as well, packets may get transmitted earlier.
Definition at line 177 of file flow_control.cpp.
|
private |
Definition at line 53 of file flow_control.cpp.
| void vanetza::dcc::FlowControl::set_packet_drop_hook | ( | PacketDropHook::callback_type && | cb | ) |
Set callback to be invoked at packet drop. Replaces any previous callback.
| cb | Callback |
Definition at line 162 of file flow_control.cpp.
| void vanetza::dcc::FlowControl::set_packet_transmit_hook | ( | PacketTransmitHook::callback_type && | cb | ) |
Set callback to be invoked at packet transmission. Replaces any previous callback.
| cb | Callback |
Definition at line 167 of file flow_control.cpp.
|
private |
Definition at line 150 of file flow_control.cpp.
|
private |
Definition at line 87 of file flow_control.cpp.
|
private |
Definition at line 38 of file flow_control.cpp.
|
private |
Definition at line 115 of file flow_control.hpp.
|
private |
Definition at line 118 of file flow_control.hpp.
|
private |
Definition at line 119 of file flow_control.hpp.
|
private |
Definition at line 117 of file flow_control.hpp.
|
private |
Definition at line 116 of file flow_control.hpp.
|
private |
Definition at line 113 of file flow_control.hpp.
|
private |
Definition at line 114 of file flow_control.hpp.