Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Packet.h
Go to the documentation of this file.
1#ifndef ULT_NETWORK_PACKET_H_INCLUDED
2#define ULT_NETWORK_PACKET_H_INCLUDED
3
4#include <cstring>
6#include <Ult/Endian.h>
7
8namespace Ult
9{
10
15class Packet
16{
17public:
25 Packet(NetPacketValue usage, NetPacketValue id, const char* data, int size);
29 ~Packet();
30
34 int GetPacketSize() const { return sizeof(*this); }
38 NetPacketValue GetUsage() const { return mUsage; }
42 NetPacketValue GetId() const { return mId; }
46 NetPacketValue* GetData() { return mData; }
47
51 int GetDataSize();
52
53private:
54 NetPacketValue mUsage;
56 int mDataSize;
58};
59
60} // namespace Ult
61
62#endif // ULT_NETWORK_PACKET_H_INCLUDED
63
NetPacketValue GetId() const
Definition Packet.h:42
NetPacketValue * GetData()
Definition Packet.h:46
int GetPacketSize() const
Definition Packet.h:34
NetPacketValue GetUsage() const
Definition Packet.h:38
int GetDataSize()
Definition Packet.cpp:24
Packet(NetPacketValue usage, NetPacketValue id, const char *data, int size)
Definition Packet.cpp:6
~Packet()
Definition Packet.cpp:20
char NetPacketValue
Definition Types.h:66
constexpr size_t MAX_PACKET_SIZE
Definition Types.h:68
Definition Archive.h:13