![]() |
xyginext
0.2.0
Second generation of xygine game creation framework
|
Event packet. Contains packet data recieved by PacketRecieved event. Not valid for other event types. More...
#include <NetData.hpp>
Public Member Functions | |
Packet (const Packet &)=delete | |
Packet (Packet &&)=delete | |
Packet & | operator= (const Packet &)=delete |
Packet & | operator= (Packet &&)=delete |
std::uint8_t | getID () const |
The unique ID this packet was tegged with when sent. | |
template<typename T > | |
T | as () const |
Used to retreive the data as a specific type. Trying to read data as an incorrect type will lead to undefined behaviour. | |
const void * | getData () const |
Returns a pointer to the raw packet data. | |
std::size_t | getSize () const |
Returns the size of the data, in bytes. | |
void | setPacketData (const std::uint8_t *, std::size_t) |
Used by active implementation to set packet data. DO NOT USE DIRECTLY. | |
template<typename T > | |
T | as () const |
Event packet. Contains packet data recieved by PacketRecieved event. Not valid for other event types.