Vanetza
 
Loading...
Searching...
No Matches
transmission.hpp
1#ifndef TRANSMISSION_HPP_SDC4RMQE
2#define TRANSMISSION_HPP_SDC4RMQE
3
4#include <vanetza/access/data_rates.hpp>
5#include <vanetza/common/clock.hpp>
6#include <vanetza/dcc/profile.hpp>
7#include <cstddef>
8
9namespace vanetza
10{
11namespace dcc
12{
13
15{
16public:
17 virtual Profile profile() const = 0;
18 virtual const access::DataRateG5* data_rate() const = 0;
19 virtual std::size_t body_length() const = 0;
20 virtual Clock::duration channel_occupancy() const;
21 virtual ~Transmission() = default;
22};
23
25{
26 constexpr TransmissionLite(Profile dp, std::size_t len) : m_profile(dp), m_length(len) {}
27
28 Profile m_profile;
29 std::size_t m_length = 0; /*< length in bytes of MAC frame body */
30 const access::DataRateG5* m_data_rate = nullptr;
31
32 Profile profile() const override { return m_profile; }
33 const access::DataRateG5* data_rate() const override { return m_data_rate; }
34 std::size_t body_length() const override { return m_length; }
35};
36
37} // namespace dcc
38} // namespace vanetza
39
40#endif /* TRANSMISSION_HPP_SDC4RMQE */
41