ChunckPacket is a packet consisting of several memory chunks. More...
#include <chunk_packet.hpp>
Public Member Functions | |
ChunkPacket (const ChunkPacket &) | |
ChunkPacket & | operator= (const ChunkPacket &) |
ChunkPacket (ChunkPacket &&)=default | |
ChunkPacket & | operator= (ChunkPacket &&)=default |
ByteBufferConvertible & | layer (OsiLayer ol) |
const ByteBufferConvertible & | layer (OsiLayer ol) const |
ByteBufferConvertible & | operator[] (OsiLayer ol) |
const ByteBufferConvertible & | operator[] (OsiLayer ol) const |
std::size_t | size () const |
std::size_t | size (OsiLayer from, OsiLayer to) const |
ChunkPacket | extract (OsiLayer from, OsiLayer to) |
ChunkPacket & | merge (ChunkPacket &packet, OsiLayer from, OsiLayer to) |
Private Types | |
typedef std::map< OsiLayer, ByteBufferConvertible > | map_type |
Private Attributes | |
map_type | m_layers |
ChunckPacket is a packet consisting of several memory chunks.
ChunkPacket is the preferred packet type when it is getting assembled step by step. Each layer can easily add further bytes without caring about other layers at all.
Definition at line 18 of file chunk_packet.hpp.
|
private |
Definition at line 85 of file chunk_packet.hpp.
vanetza::ChunkPacket::ChunkPacket | ( | ) |
Definition at line 10 of file chunk_packet.cpp.
vanetza::ChunkPacket::ChunkPacket | ( | const ChunkPacket & | other | ) |
Definition at line 14 of file chunk_packet.cpp.
ChunkPacket vanetza::ChunkPacket::extract | ( | OsiLayer | from, |
OsiLayer | to | ||
) |
Extract a range of layers from this packet to a new one. The respective layers of this ChunkPacket are empty afterwards.
from | start at this layer (inclusive) |
to | stop at this layer (inclusive) |
Definition at line 67 of file chunk_packet.cpp.
ByteBufferConvertible & vanetza::ChunkPacket::layer | ( | OsiLayer | ol | ) |
Access ByteBufferConvertible of specific layer
layer | ol Access this layer's data |
Definition at line 28 of file chunk_packet.cpp.
const ByteBufferConvertible & vanetza::ChunkPacket::layer | ( | OsiLayer | ol | ) | const |
Access ByteBufferConvertible of specific layer
layer | ol Access this layer's data |
Definition at line 33 of file chunk_packet.cpp.
ChunkPacket & vanetza::ChunkPacket::merge | ( | ChunkPacket & | packet, |
OsiLayer | from, | ||
OsiLayer | to | ||
) |
Merge layers from another packet
packet | source packet (layers will be moved from there) |
from | start at this layer (inclusive) |
to | stop at this layer (inclusive) |
Definition at line 77 of file chunk_packet.cpp.
ChunkPacket & vanetza::ChunkPacket::operator= | ( | const ChunkPacket & | other | ) |
Definition at line 21 of file chunk_packet.cpp.
|
inline |
Access ByteBufferConvertible of specific layer
layer | ol Access this layer's data |
Definition at line 41 of file chunk_packet.hpp.
|
inline |
Access ByteBufferConvertible of specific layer
layer | ol Access this layer's data |
Definition at line 47 of file chunk_packet.hpp.
std::size_t vanetza::ChunkPacket::size | ( | ) | const |
Get size of whole payload
Definition at line 44 of file chunk_packet.cpp.
std::size_t vanetza::ChunkPacket::size | ( | OsiLayer | from, |
OsiLayer | to | ||
) | const |
Get size of payload from specified layer range
from | start counting including this layer |
to | stop counting including this layer |
Definition at line 55 of file chunk_packet.cpp.
|
private |
Definition at line 86 of file chunk_packet.hpp.