Vanetza
Loading...
Searching...
No Matches
traffic_class.hpp
1
#ifndef TRAFFIC_CLASS_HPP_I2WYKREX
2
#define TRAFFIC_CLASS_HPP_I2WYKREX
3
4
#include <vanetza/common/bit_number.hpp>
5
#include <vanetza/dcc/profile.hpp>
6
#include <vanetza/geonet/serialization.hpp>
7
#include <cstdint>
8
9
namespace
vanetza
10
{
11
12
namespace
geonet
13
{
14
15
class
TrafficClass
16
{
17
public
:
18
TrafficClass
();
19
TrafficClass
(
bool
scf,
bool
channel_offload,
BitNumber<unsigned, 6>
tc_id);
20
explicit
TrafficClass
(uint8_t raw);
21
22
bool
store_carry_forward()
const
;
23
void
store_carry_forward(
bool
flag);
24
bool
channel_offload()
const
;
25
void
channel_offload(
bool
flag);
26
BitNumber<unsigned, 6>
tc_id()
const
;
27
void
tc_id(
BitNumber<unsigned, 6>
id
);
28
uint8_t raw()
const
{
return
m_tc; }
29
30
private
:
31
static
constexpr
uint8_t scf_mask = 0x80;
32
static
constexpr
uint8_t channel_offload_mask = 0x40;
33
static
constexpr
uint8_t tc_id_mask = 0x3f;
34
uint8_t m_tc;
35
};
36
37
dcc::Profile map_tc_onto_profile(
const
TrafficClass
&);
38
39
void
serialize(
const
TrafficClass
&,
OutputArchive
&);
40
void
deserialize(
TrafficClass
&,
InputArchive
&);
41
42
}
// namespace geonet
43
}
// namespace vanetza
44
45
#endif
/* TRAFFIC_CLASS_HPP_I2WYKREX */
46
vanetza::BitNumber
Definition:
bit_number.hpp:18
vanetza::InputArchive
Definition:
archives.hpp:17
vanetza::OutputArchive
Definition:
archives.hpp:50
vanetza::geonet::TrafficClass
Definition:
traffic_class.hpp:16
vanetza
geonet
traffic_class.hpp
Generated on Thu Nov 30 2023 12:03:35 for Vanetza by
1.9.6