1#ifndef VANETZA_CERTIFICATE_CACHE_HPP
2#define VANETZA_CERTIFICATE_CACHE_HPP
4#include <vanetza/common/clock.hpp>
5#include <vanetza/common/runtime.hpp>
6#include <vanetza/security/v2/certificate.hpp>
7#include <boost/heap/binomial_heap.hpp>
41 std::list<Certificate>
lookup(
const HashedId8&
id, SubjectType type);
47 std::size_t
size()
const {
return m_certificates.size(); }
50 struct CachedCertificate;
51 using map_type = std::multimap<HashedId8, CachedCertificate>;
53 struct Expiry :
public Clock::time_point
55 Expiry(Clock::time_point, map_type::iterator);
56 const map_type::iterator certificate;
59 using heap_type = boost::heap::binomial_heap<Expiry, boost::heap::compare<std::greater<Expiry>>>;
64 heap_type::handle_type handle;
69 map_type m_certificates;
72 bool is_expired(
const Expiry&)
const;
73 void refresh(heap_type::handle_type&, Clock::duration);
void insert(const Certificate &certificate)
std::list< Certificate > lookup(const HashedId8 &id, SubjectType type)
described in TS 103 097 v1.2.1 (2015-06), section 6.1