17 void Serialize(uint8_t * buffer)
const override;
19 uint32_t
Size()
const override;
22 std::shared_ptr<IPacket>
Clone()
const override;
24 uint64_t
GetId()
const;
25 void SetId(uint64_t
id);
an abstract class that servers as a base for all network packets
Definition: IPacket.hpp:40
Type
Definition: IPacket.hpp:48
Definition: PingPacket.hpp:7
uint32_t Size() const override
return the size of the packet in bytes, usually used to reserve the right amount of memory in the sen...
Definition: PingPacket.cpp:71
void SetCounter(uint8_t counter)
Definition: PingPacket.cpp:106
void Deserialize(const uint8_t *buffer) override
read the packet from the buffer, the buffer must at least be of size Size()
Definition: PingPacket.cpp:59
uint8_t GetCounter() const
Definition: PingPacket.cpp:101
uint64_t GetId() const
Definition: PingPacket.cpp:91
PingPacket()
Definition: PingPacket.cpp:3
bool HasDynamicSize() const override
Tell if the packet has a dynamic size.
Definition: PingPacket.cpp:76
enum Type GetType() const override
Get the Type of the packet.
Definition: PingPacket.cpp:81
void Serialize(uint8_t *buffer) const override
will write the packet in the buffer, the buffer must at least be of size Size()
Definition: PingPacket.cpp:45
std::shared_ptr< IPacket > Clone() const override
Create a new instance of the packet.
Definition: PingPacket.cpp:86
~PingPacket()
Definition: PingPacket.cpp:41
void SetId(uint64_t id)
Definition: PingPacket.cpp:96
PingPacket & operator=(const PingPacket &)
Definition: PingPacket.cpp:23