#include <Packet.hpp>
Public Member Functions | |
sfPacket () | |
~sfPacket () | |
void | Append (const void *Data, std::size_t SizeInBytes) |
void | Clear () |
const char * | GetData () const |
sfUint32 | GetDataSize () const |
sfPacket & | operator>> (sfInt8 &Data) |
sfPacket & | operator>> (sfUint8 &Data) |
sfPacket & | operator>> (sfInt16 &Data) |
sfPacket & | operator>> (sfUint16 &Data) |
sfPacket & | operator>> (sfInt32 &Data) |
sfPacket & | operator>> (sfUint32 &Data) |
sfPacket & | operator>> (float &Data) |
sfPacket & | operator>> (double &Data) |
sfPacket & | operator>> (char *Data) |
sfPacket & | operator>> (std::string &Data) |
sfPacket & | operator<< (sfInt8 Data) |
sfPacket & | operator<< (sfUint8 Data) |
sfPacket & | operator<< (sfInt16 Data) |
sfPacket & | operator<< (sfUint16 Data) |
sfPacket & | operator<< (sfInt32 Data) |
sfPacket & | operator<< (sfUint32 Data) |
sfPacket & | operator<< (float Data) |
sfPacket & | operator<< (double Data) |
sfPacket & | operator<< (const char *Data) |
sfPacket & | operator<< (const std::string &Data) |
Friends | |
class | sfSocketTCP |
class | sfSocketUDP |
Definition at line 39 of file Packet.hpp.
sfPacket::sfPacket | ( | ) |
Default constructor
Definition at line 35 of file Packet.cpp.
sfPacket::~sfPacket | ( | ) |
Virtual destructor
Definition at line 45 of file Packet.cpp.
void sfPacket::Append | ( | const void * | Data, | |
std::size_t | SizeInBytes | |||
) |
Append data to the end of the packet
Data | : Pointer to the bytes to append | |
SizeInBytes | : Number of bytes to append |
Definition at line 54 of file Packet.cpp.
Referenced by operator<<(), sfSocketUDP::Receive(), and sfSocketTCP::Receive().
void sfPacket::Clear | ( | ) |
Clear the packet data
Definition at line 64 of file Packet.cpp.
Referenced by sfSocketUDP::Receive(), and sfSocketTCP::Receive().
const char * sfPacket::GetData | ( | ) | const |
Get a pointer to the data contained in the packet Warning : the returned pointer may be invalid after you append data to the packet
Definition at line 76 of file Packet.cpp.
Referenced by operator>>(), sfSocketUDP::Send(), and sfSocketTCP::Send().
sfUint32 sfPacket::GetDataSize | ( | ) | const |
Get the size of the data contained in the packet
Definition at line 85 of file Packet.cpp.
Referenced by sfSocketUDP::Receive(), sfSocketTCP::Receive(), sfSocketUDP::Send(), and sfSocketTCP::Send().
sfPacket & sfPacket::operator>> | ( | sfInt8 & | Data | ) |
Operator >> overloads to extract data from the packet
Definition at line 94 of file Packet.cpp.
References GetData().
sfPacket & sfPacket::operator<< | ( | sfInt8 | Data | ) |
Operator << overloads to put data into the packet
Definition at line 176 of file Packet.cpp.
References Append().