Vanetza
 
Loading...
Searching...
No Matches
vanetza::geonet::CbfCounterContending Class Referenceabstract

#include <cbf_counter.hpp>

Inheritance diagram for vanetza::geonet::CbfCounterContending:

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
 
virtual void increment (const id_type &id)=0
 
virtual counter_type counter (const id_type &id) const =0
 

Private Member Functions

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

Private Attributes

std::unordered_map< id_type, counter_type > m_counters
 

Detailed Description

Remembers only counter values for packets currently contending, i.e. stored in CBF buffer.

Note
This is the ADVANCED routing behaviour of EN 302 636-4-1 v1.2.1

Definition at line 77 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::CbfCounterContending::add ( const id_type &  id)
overridevirtual

Packet has been added to buffer

Parameters
idpacket identifier

Implements vanetza::geonet::CbfCounter.

Definition at line 29 of file cbf_counter.cpp.

◆ counter() [1/2]

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

Retrieve counter value

Parameters
idpacket identifier

Implements vanetza::geonet::CbfCounter.

Definition at line 19 of file cbf_counter.cpp.

◆ counter() [2/2]

virtual counter_type vanetza::geonet::CbfCounter::counter ( const id_type &  id) const
pure virtualinherited

Retrieve counter value

Parameters
idpacket identifier

Implemented in vanetza::geonet::CbfCounterImmortal, and vanetza::geonet::CbfCounterFading.

◆ increment() [1/2]

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

Increment packet counter by one

Parameters
idpacket identifier

Implements vanetza::geonet::CbfCounter.

Definition at line 14 of file cbf_counter.cpp.

◆ increment() [2/2]

virtual void vanetza::geonet::CbfCounter::increment ( const id_type &  id)
pure virtualinherited

Increment packet counter by one

Parameters
idpacket identifier

Implemented in vanetza::geonet::CbfCounterImmortal, and vanetza::geonet::CbfCounterFading.

◆ remove()

void vanetza::geonet::CbfCounterContending::remove ( const id_type &  id)
overridevirtual

Packet has been removed from buffer.

Parameters
idpacket identifier

Implements vanetza::geonet::CbfCounter.

Definition at line 34 of file cbf_counter.cpp.

Member Data Documentation

◆ m_counters

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

Definition at line 70 of file cbf_counter.hpp.


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