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
9namespace vanetza
10{
11
12namespace geonet
13{
14
16{
17public:
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
30private:
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
37dcc::Profile map_tc_onto_profile(const TrafficClass&);
38
39void serialize(const TrafficClass&, OutputArchive&);
40void deserialize(TrafficClass&, InputArchive&);
41
42} // namespace geonet
43} // namespace vanetza
44
45#endif /* TRAFFIC_CLASS_HPP_I2WYKREX */
ChunckPacket is a packet consisting of several memory chunks.
ByteBufferConvertible & operator[](OsiLayer ol)
ChunkPacket & merge(ChunkPacket &packet, OsiLayer from, OsiLayer to)
std::size_t size() const
const ByteBufferConvertible & layer(OsiLayer ol) const
const ByteBufferConvertible & operator[](OsiLayer ol) const
ByteBufferConvertible & layer(OsiLayer ol)
std::size_t size(OsiLayer from, OsiLayer to) const
ChunkPacket extract(OsiLayer from, OsiLayer to)
std::size_t size(OsiLayer from, OsiLayer to) const
buffer_const_range operator[](OsiLayer layer) const
std::size_t size() const
void set_boundary(OsiLayer, unsigned bytes)
const ByteBuffer & buffer() const
CohesivePacket(const ByteBuffer &buffer, OsiLayer layer)
void trim(OsiLayer from, unsigned bytes)
std::size_t size(OsiLayer single_layer) const
value_type operator[](size_type) const
Definition byte_view.cpp:48
byte_view_range(ByteBuffer &&)
Definition byte_view.cpp:37
byte_view_range(const ByteBuffer::const_iterator &, const ByteBuffer::const_iterator &)
Definition byte_view.cpp:27
ByteBuffer::const_pointer data() const
Definition byte_view.cpp:42
void encode(units::Duration)
Definition lifetime.cpp:45
units::Duration decode() const
Definition lifetime.cpp:59