Vanetza
 
Loading...
Searching...
No Matches
vanetza::geonet::CbfCounterImmortal Class Reference

#include <cbf_counter.hpp>

Inheritance diagram for vanetza::geonet::CbfCounterImmortal:

Public Types

using id_type = CbfPacketIdentifier
 
using counter_type = std::size_t
 

Public Member Functions

void add (const id_type &) override
 
void remove (const id_type &) override
 
void increment (const id_type &) override
 
counter_type counter (const id_type &) const override
 

Protected Attributes

std::unordered_map< id_type, counter_type > m_counters
 

Detailed Description

Immortal CBF counters, i.e. they never expire.

Note
Be aware, memory consumption is constantly growing of this implemenation!

Definition at line 61 of file cbf_counter.hpp.

Member Typedef Documentation

◆ counter_type

using vanetza::geonet::CbfCounter::counter_type = std::size_t
inherited

Definition at line 27 of file cbf_counter.hpp.

◆ id_type

using vanetza::geonet::CbfCounter::id_type = CbfPacketIdentifier
inherited

Definition at line 26 of file cbf_counter.hpp.

Member Function Documentation

◆ add()

void vanetza::geonet::CbfCounterImmortal::add ( const id_type &  id)
overridevirtual

Packet has been added to buffer

Parameters
idpacket identifier

Implements vanetza::geonet::CbfCounter.

Reimplemented in vanetza::geonet::CbfCounterContending.

Definition at line 9 of file cbf_counter.cpp.

◆ counter()

auto vanetza::geonet::CbfCounterImmortal::counter ( const id_type &  id) const
overridevirtual

Retrieve counter value

Parameters
idpacket identifier

Implements vanetza::geonet::CbfCounter.

Definition at line 19 of file cbf_counter.cpp.

◆ increment()

void vanetza::geonet::CbfCounterImmortal::increment ( const id_type &  id)
overridevirtual

Increment packet counter by one

Parameters
idpacket identifier

Implements vanetza::geonet::CbfCounter.

Definition at line 14 of file cbf_counter.cpp.

◆ remove()

void vanetza::geonet::CbfCounterImmortal::remove ( const id_type &  id)
inlineoverridevirtual

Packet has been removed from buffer.

Parameters
idpacket identifier

Implements vanetza::geonet::CbfCounter.

Reimplemented in vanetza::geonet::CbfCounterContending.

Definition at line 65 of file cbf_counter.hpp.

Member Data Documentation

◆ m_counters

std::unordered_map<id_type, counter_type> vanetza::geonet::CbfCounterImmortal::m_counters
protected

Definition at line 70 of file cbf_counter.hpp.


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