#include <gbc_memory.hpp>
Classes | |
struct | by_packet |
struct | by_queue |
Public Types | |
using | PacketIdentifier = CbfPacketIdentifier |
Public Member Functions | |
void | capacity (std::size_t num) |
std::size_t | size () const |
bool | remember (const PacketIdentifier &id) |
bool | knows (const PacketIdentifier &id) const |
Private Types | |
using | packet_index = boost::multi_index::hashed_unique< boost::multi_index::tag< by_packet >, boost::multi_index::identity< PacketIdentifier >, std::hash< PacketIdentifier > > |
using | queue_index = boost::multi_index::sequenced< boost::multi_index::tag< by_queue > > |
using | container_type = boost::multi_index_container< PacketIdentifier, boost::multi_index::indexed_by< queue_index, packet_index > > |
Private Attributes | |
std::size_t | m_capacity = 1 |
container_type | m_identifiers |
GbcMemory remembers previously seens GBC packets.
GBC packets are identified by their (GN addr, sequence number) tuple. The size of GbcMemory is bounded, i.e. it will forget old packets in favour of recent ones.
Definition at line 20 of file gbc_memory.hpp.
|
private |
Definition at line 63 of file gbc_memory.hpp.
|
private |
Definition at line 55 of file gbc_memory.hpp.
using vanetza::geonet::GbcMemory::PacketIdentifier = CbfPacketIdentifier |
Definition at line 23 of file gbc_memory.hpp.
|
private |
Definition at line 61 of file gbc_memory.hpp.
void vanetza::geonet::GbcMemory::capacity | ( | std::size_t | num | ) |
Forget a packet if memory exceeds upper limit of stored identifiers
num | upper limit of remembered packets |
Definition at line 8 of file gbc_memory.cpp.
bool vanetza::geonet::GbcMemory::knows | ( | const PacketIdentifier & | id | ) | const |
Check if a particular packet is known
id | packet identifier |
Definition at line 46 of file gbc_memory.cpp.
bool vanetza::geonet::GbcMemory::remember | ( | const PacketIdentifier & | id | ) |
Remember a particular packet
id | packet identifier |
Definition at line 24 of file gbc_memory.cpp.
std::size_t vanetza::geonet::GbcMemory::size | ( | ) | const |
Number of currently known packets
Definition at line 19 of file gbc_memory.cpp.
|
private |
Definition at line 52 of file gbc_memory.hpp.
|
private |
Definition at line 65 of file gbc_memory.hpp.