Vanetza
 
Loading...
Searching...
No Matches
vanetza::dcc::FlowControl Class Reference

#include <flow_control.hpp>

Inheritance diagram for vanetza::dcc::FlowControl:

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< PendingTransmissiondequeue ()
 
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 &)
 
PendingTransmissionnext_transmission ()
 
Queue * next_queue ()
 

Private Attributes

Runtimem_runtime
 
TransmitRateControlm_trc
 
access::Interfacem_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
 

Detailed Description

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.

Member Typedef Documentation

◆ PacketDropHook

◆ PacketTransmitHook

◆ Queue

using vanetza::dcc::FlowControl::Queue = std::list<PendingTransmission>
private

Definition at line 100 of file flow_control.hpp.

Constructor & Destructor Documentation

◆ FlowControl()

vanetza::dcc::FlowControl::FlowControl ( Runtime runtime,
TransmitRateControl trc,
access::Interface ifc 
)

Create FlowControl instance

Parameters
rtRuntime used for timed actions, e.g. packet expiry
schedulerScheduler providing transmission intervals
accessInterface to access layer

Definition at line 15 of file flow_control.cpp.

◆ ~FlowControl()

vanetza::dcc::FlowControl::~FlowControl ( )

Definition at line 20 of file flow_control.cpp.

Member Function Documentation

◆ dequeue()

boost::optional< FlowControl::PendingTransmission > vanetza::dcc::FlowControl::dequeue ( )
private

Definition at line 75 of file flow_control.cpp.

◆ drop_expired()

void vanetza::dcc::FlowControl::drop_expired ( )
private

Definition at line 135 of file flow_control.cpp.

◆ empty()

bool vanetza::dcc::FlowControl::empty ( ) const
private

Definition at line 103 of file flow_control.cpp.

◆ enqueue()

void vanetza::dcc::FlowControl::enqueue ( const DataRequest request,
std::unique_ptr< ChunkPacket packet 
)
private

Definition at line 59 of file flow_control.cpp.

◆ next_queue()

FlowControl::Queue * vanetza::dcc::FlowControl::next_queue ( )
private

Definition at line 111 of file flow_control.cpp.

◆ next_transmission()

FlowControl::PendingTransmission * vanetza::dcc::FlowControl::next_transmission ( )
private

Definition at line 129 of file flow_control.cpp.

◆ queue_length()

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.

Parameters
lengthMaximum number of queue elements, 0 for unlimited length

Definition at line 172 of file flow_control.cpp.

◆ request()

void vanetza::dcc::FlowControl::request ( const DataRequest request,
std::unique_ptr< ChunkPacket packet 
)
overridevirtual

Request packet transmission

Parameters
requestDCC request parameters
packetPacket data

Implements vanetza::dcc::RequestInterface.

Definition at line 25 of file flow_control.cpp.

◆ reschedule()

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.

◆ schedule_trigger()

void vanetza::dcc::FlowControl::schedule_trigger ( const Transmission tx)
private

Definition at line 53 of file flow_control.cpp.

◆ set_packet_drop_hook()

void vanetza::dcc::FlowControl::set_packet_drop_hook ( PacketDropHook::callback_type &&  cb)

Set callback to be invoked at packet drop. Replaces any previous callback.

Parameters
cbCallback

Definition at line 162 of file flow_control.cpp.

◆ set_packet_transmit_hook()

void vanetza::dcc::FlowControl::set_packet_transmit_hook ( PacketTransmitHook::callback_type &&  cb)

Set callback to be invoked at packet transmission. Replaces any previous callback.

Parameters
cbCallback

Definition at line 167 of file flow_control.cpp.

◆ transmit()

void vanetza::dcc::FlowControl::transmit ( const DataRequest request,
std::unique_ptr< ChunkPacket packet 
)
private

Definition at line 150 of file flow_control.cpp.

◆ transmit_immediately()

bool vanetza::dcc::FlowControl::transmit_immediately ( const Transmission transmission) const
private

Definition at line 87 of file flow_control.cpp.

◆ trigger()

void vanetza::dcc::FlowControl::trigger ( )
private

Definition at line 38 of file flow_control.cpp.

Member Data Documentation

◆ m_access

access::Interface& vanetza::dcc::FlowControl::m_access
private

Definition at line 115 of file flow_control.hpp.

◆ m_packet_drop_hook

PacketDropHook vanetza::dcc::FlowControl::m_packet_drop_hook
private

Definition at line 118 of file flow_control.hpp.

◆ m_packet_transmit_hook

PacketTransmitHook vanetza::dcc::FlowControl::m_packet_transmit_hook
private

Definition at line 119 of file flow_control.hpp.

◆ m_queue_length

std::size_t vanetza::dcc::FlowControl::m_queue_length
private

Definition at line 117 of file flow_control.hpp.

◆ m_queues

std::map<access::AccessCategory, Queue, std::greater<access::AccessCategory> > vanetza::dcc::FlowControl::m_queues
private

Definition at line 116 of file flow_control.hpp.

◆ m_runtime

Runtime& vanetza::dcc::FlowControl::m_runtime
private

Definition at line 113 of file flow_control.hpp.

◆ m_trc

TransmitRateControl& vanetza::dcc::FlowControl::m_trc
private

Definition at line 114 of file flow_control.hpp.


The documentation for this class was generated from the following files: