21 : header{}, body{}, _readPos(0)
48 asio::const_buffer(
body.data(),
body.size())
Assertion and verification macros for runtime checks.
Logger declaration with support for multiple log levels.
std::array< asio::const_buffer, 2 > BufferSequence
File : Packet.cpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue.hajjar-llauquen@epite...
Network packet implementation for R-Type protocol.
static T to_network(T v)
Converts a primitive type (integer, float) from machine endianness to Big-Endian (network).
size_t _readPos
Current read position in body.
void resetRead(void)
Reset read position to beginning of body.
Header _cacheHeader
Cached header with network endianness.
BufferSequence getBufferSequence(void) const
Get buffer sequence for network transmission.
std::vector< uint8_t > body
Packet body/payload.
Packet()=default
Default constructor.
Header header
Packet header.
File : IEventPublisher.hpp License: MIT Author : Elias Josué HAJJAR LLAUQUEN elias-josue....
constexpr uint16_t MAGIC_NUMBER
Magic number for packet validation.
OpCode
Operation codes for different packet types.
std::array< asio::const_buffer, 2 > BufferSequence
@using BufferSequence