#include <cohesive_packet.hpp>
A cohesive packet is stored in contiguous memory
Definition at line 15 of file cohesive_packet.hpp.
◆ buffer_const_range
typedef boost::iterator_range<ByteBuffer::const_iterator> vanetza::CohesivePacket::buffer_const_range |
◆ buffer_range
typedef boost::iterator_range<ByteBuffer::iterator> vanetza::CohesivePacket::buffer_range |
◆ CohesivePacket() [1/3]
vanetza::CohesivePacket::CohesivePacket |
( |
const ByteBuffer & |
buffer, |
|
|
OsiLayer |
layer |
|
) |
| |
Create packet from buffer and assign all bytes to given layer
- Parameters
-
buffer | copy data from this buffer |
layer | all bytes belong to this layer (at least at first) |
Definition at line 16 of file cohesive_packet.cpp.
◆ CohesivePacket() [2/3]
vanetza::CohesivePacket::CohesivePacket |
( |
ByteBuffer && |
buffer, |
|
|
OsiLayer |
layer |
|
) |
| |
◆ CohesivePacket() [3/3]
vanetza::CohesivePacket::CohesivePacket |
( |
const CohesivePacket & |
other | ) |
|
◆ buffer()
const ByteBuffer & vanetza::CohesivePacket::buffer |
( |
| ) |
const |
|
inline |
Non-mutable access to internal byte buffer
- Returns
- const byte buffer reference
Definition at line 84 of file cohesive_packet.hpp.
◆ get() [1/2]
auto vanetza::CohesivePacket::get |
( |
unsigned |
idx | ) |
|
|
private |
◆ get() [2/2]
auto vanetza::CohesivePacket::get |
( |
unsigned |
idx | ) |
const |
|
private |
◆ operator=()
◆ operator[]() [1/2]
auto vanetza::CohesivePacket::operator[] |
( |
OsiLayer |
layer | ) |
|
◆ operator[]() [2/2]
auto vanetza::CohesivePacket::operator[] |
( |
OsiLayer |
layer | ) |
const |
Access a certain sub-range of packet data belonging to a specific layer
- Parameters
-
layer | requested layer data |
- Returns
- buffer range with data, might be empty
Definition at line 41 of file cohesive_packet.cpp.
◆ rebuild_iterators()
void vanetza::CohesivePacket::rebuild_iterators |
( |
const CohesivePacket & |
other | ) |
|
|
private |
◆ reset_iterators()
void vanetza::CohesivePacket::reset_iterators |
( |
OsiLayer |
layer | ) |
|
|
private |
◆ set_boundary()
void vanetza::CohesivePacket::set_boundary |
( |
OsiLayer |
layer, |
|
|
unsigned |
bytes |
|
) |
| |
Set boundary of layer data. Data beyond boundary belongs to next upper layer afterwards.
- Parameters
-
layer | set boundary of this layer |
bytes | length of layer |
- Note
- Never set boundary larger than previous layer length!
Definition at line 51 of file cohesive_packet.cpp.
◆ size() [1/3]
std::size_t vanetza::CohesivePacket::size |
( |
| ) |
const |
◆ size() [2/3]
std::size_t vanetza::CohesivePacket::size |
( |
OsiLayer |
from, |
|
|
OsiLayer |
to |
|
) |
| const |
Get size of several layers
- Parameters
-
from | start counting with this layer |
to | stop counting after this layer |
- Returns
- length in bytes
Definition at line 85 of file cohesive_packet.cpp.
◆ size() [3/3]
std::size_t vanetza::CohesivePacket::size |
( |
OsiLayer |
single_layer | ) |
const |
Get size of a single layer in packet
- Parameters
-
single_layer | which layer has to be considered |
- Returns
- length in bytes
Definition at line 80 of file cohesive_packet.cpp.
◆ trim()
void vanetza::CohesivePacket::trim |
( |
OsiLayer |
from, |
|
|
unsigned |
bytes |
|
) |
| |
Trim size of packet, i.e. cut bytes at the end if too long.
- Parameters
-
from | start counting with this layer |
bytes | target length in bytes |
Definition at line 58 of file cohesive_packet.cpp.
◆ m_buffer
ByteBuffer vanetza::CohesivePacket::m_buffer |
|
private |
◆ m_iterators
std::array<ByteBuffer::iterator, osi_layers.size() + 1> vanetza::CohesivePacket::m_iterators |
|
private |
The documentation for this class was generated from the following files: