1#ifndef GBC_MEMORY_HPP_032N8PRJ
2#define GBC_MEMORY_HPP_032N8PRJ
4#include <vanetza/geonet/cbf_packet_identifier.hpp>
5#include <boost/multi_index_container.hpp>
6#include <boost/multi_index/hashed_index.hpp>
7#include <boost/multi_index/sequenced_index.hpp>
23 using PacketIdentifier = CbfPacketIdentifier;
35 std::size_t
size()
const;
42 bool remember(
const PacketIdentifier&
id);
49 bool knows(
const PacketIdentifier&
id)
const;
52 std::size_t m_capacity = 1;
55 using packet_index = boost::multi_index::hashed_unique<
56 boost::multi_index::tag<by_packet>,
57 boost::multi_index::identity<PacketIdentifier>,
58 std::hash<PacketIdentifier>
61 using queue_index = boost::multi_index::sequenced<boost::multi_index::tag<by_queue>>;
63 using container_type = boost::multi_index_container<PacketIdentifier,
64 boost::multi_index::indexed_by<queue_index, packet_index>>;
65 container_type m_identifiers;
bool remember(const PacketIdentifier &id)
bool knows(const PacketIdentifier &id) const
void capacity(std::size_t num)