#include <packet_runtime.h>
|
| slice ()=default |
|
| slice (slice const &)=default |
|
| slice (std::shared_ptr< const std::vector< uint8_t > > packet) |
|
| slice (std::shared_ptr< const std::vector< uint8_t > > packet, size_t offset, size_t size) |
|
slice | subrange (size_t offset, size_t size) const |
|
template<typename T , size_t N = sizeof(T)> |
T | read_le () |
|
template<typename T , size_t N = sizeof(T)> |
T | read_be () |
|
uint8_t | at (size_t offset) const |
|
void | skip (size_t size) |
|
void | clear () |
| Empty the slice. More...
|
|
size_t | size () const |
| Return the size of the slice in bytes. More...
|
|
std::vector< uint8_t > | bytes () const |
| Return the contents of the slice as a byte vector. More...
|
|
bool | operator== (slice const &other) const |
|
Representation of a raw packet slice. The slice contains a shared pointer to the source packet bytes, and points to a subrange within this byte buffer.
◆ slice() [1/4]
pdl::packet::slice::slice |
( |
| ) |
|
|
default |
◆ slice() [2/4]
pdl::packet::slice::slice |
( |
slice const & |
| ) |
|
|
default |
◆ slice() [3/4]
pdl::packet::slice::slice |
( |
std::shared_ptr< const std::vector< uint8_t > > |
packet | ) |
|
|
inline |
◆ slice() [4/4]
pdl::packet::slice::slice |
( |
std::shared_ptr< const std::vector< uint8_t > > |
packet, |
|
|
size_t |
offset, |
|
|
size_t |
size |
|
) |
| |
|
inline |
◆ at()
uint8_t pdl::packet::slice::at |
( |
size_t |
offset | ) |
const |
|
inline |
Return the value of the byte at the given offset. offset
must be within the bounds of the slice.
◆ bytes()
std::vector< uint8_t > pdl::packet::slice::bytes |
( |
| ) |
const |
|
inline |
Return the contents of the slice as a byte vector.
◆ clear()
void pdl::packet::slice::clear |
( |
| ) |
|
|
inline |
◆ operator==()
bool pdl::packet::slice::operator== |
( |
slice const & |
other | ) |
const |
|
inline |
◆ read_be()
template<typename T , size_t N = sizeof(T)>
T pdl::packet::slice::read_be |
( |
| ) |
|
|
inline |
Read a scalar value encoded in big-endian. The bytes that are read from calling this function are consumed. This function can be used to iterativaly extract values from a packet slice.
◆ read_le()
template<typename T , size_t N = sizeof(T)>
T pdl::packet::slice::read_le |
( |
| ) |
|
|
inline |
Read a scalar value encoded in little-endian. The bytes that are read from calling this function are consumed. This function can be used to iterativaly extract values from a packet slice.
◆ size()
size_t pdl::packet::slice::size |
( |
| ) |
const |
|
inline |
Return the size of the slice in bytes.
◆ skip()
void pdl::packet::slice::skip |
( |
size_t |
size | ) |
|
|
inline |
Skip size
bytes at the front of the slice. size
must be lower than or equal to the slice size.
◆ subrange()
slice pdl::packet::slice::subrange |
( |
size_t |
offset, |
|
|
size_t |
size |
|
) |
| const |
|
inline |
Return a new slice that contains the selected subrange within the current slice. The range ['offset', 'offset' + 'slice') must be contained within the bonuds of the current slice.
◆ offset_
size_t pdl::packet::slice::offset_ {0} |
|
private |
◆ packet_
std::shared_ptr<const std::vector<uint8_t> > pdl::packet::slice::packet_ |
|
private |
◆ size_
size_t pdl::packet::slice::size_ {0} |
|
private |
The documentation for this class was generated from the following file: