#include <packet_buffer.hpp>
|
| PacketBuffer (std::size_t capacity) |
|
bool | push (data_ptr packet, Clock::time_point t) |
|
void | flush (Clock::time_point t) |
|
PacketBuffer with bounded capacity, packet expiry and head-drop
Definition at line 64 of file packet_buffer.hpp.
◆ data_ptr
◆ expiry_type
◆ node_type
typedef std::tuple<expiry_type, data_ptr> vanetza::geonet::PacketBuffer::node_type |
|
private |
◆ PacketBuffer()
vanetza::geonet::PacketBuffer::PacketBuffer |
( |
std::size_t |
capacity | ) |
|
◆ capacity()
std::size_t vanetza::geonet::PacketBuffer::capacity |
( |
| ) |
const |
|
inlineprivate |
◆ drop()
bool vanetza::geonet::PacketBuffer::drop |
( |
std::size_t |
bytes | ) |
|
|
private |
Drop as many packets as required to store given number of bytes. Packets at the head of the list are dropped first.
- Parameters
-
bytes | require #bytes free capacity |
- Returns
- true if there is enough capacity left for #bytes
Definition at line 86 of file packet_buffer.cpp.
◆ drop_expired()
void vanetza::geonet::PacketBuffer::drop_expired |
( |
Clock::time_point |
t | ) |
|
|
private |
Drop all packets with expired timestamp
- Parameters
-
Definition at line 73 of file packet_buffer.cpp.
◆ drop_head()
bool vanetza::geonet::PacketBuffer::drop_head |
( |
| ) |
|
|
private |
Drop current head element
- Returns
- true if head element was dropped
Definition at line 63 of file packet_buffer.cpp.
◆ flush()
void vanetza::geonet::PacketBuffer::flush |
( |
Clock::time_point |
t | ) |
|
Flush packets from buffer. Expired packets are dropped.
- Note
- Some packets might remain in buffer (re-added during flushing)
- Parameters
-
Definition at line 46 of file packet_buffer.cpp.
◆ free()
std::size_t vanetza::geonet::PacketBuffer::free |
( |
| ) |
const |
|
inlineprivate |
◆ push() [1/2]
bool vanetza::geonet::PacketBuffer::push |
( |
data_ptr |
packet, |
|
|
Clock::time_point |
t |
|
) |
| |
Push one packet into buffer
- Parameters
-
packet | Packet data |
t | Current time |
- Returns
- true if packet has been pushed successfully
Definition at line 30 of file packet_buffer.cpp.
◆ push() [2/2]
void vanetza::geonet::PacketBuffer::push |
( |
expiry_type && |
expiry, |
|
|
data_ptr |
packet |
|
) |
| |
|
private |
Push one new element into buffer list
- Note
- capacity is not checked by this method, has to be done manually
- Parameters
-
expiry | Expiry data |
packet | Packet data |
◆ m_capacity
std::size_t vanetza::geonet::PacketBuffer::m_capacity |
|
private |
◆ m_nodes
std::list<node_type> vanetza::geonet::PacketBuffer::m_nodes |
|
private |
◆ m_stored
std::size_t vanetza::geonet::PacketBuffer::m_stored |
|
private |
The documentation for this class was generated from the following files: