Packet wraps data to send / to receive through the network. More...
#include <Packet.hpp>
Public Member Functions | |
| Packet () | |
| Default constructor. | |
| virtual | ~Packet () |
| Virtual destructor. | |
| void | Append (const void *data, std::size_t sizeInBytes) |
| Append data to the end of the packet. | |
| void | Clear () |
| Clear the packet data. | |
| const char * | 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. | |
| std::size_t | GetDataSize () const |
| Get the size of the data contained in the packet. | |
| bool | EndOfPacket () const |
| Tell if the reading position has reached the end of the packet. | |
| operator bool () const | |
| Return the validity of packet. | |
| Packet & | operator>> (bool &data) |
| Operator >> overloads to extract data from the packet. | |
| Packet & | operator>> (Int8 &data) |
| Packet & | operator>> (Uint8 &data) |
| Packet & | operator>> (Int16 &data) |
| Packet & | operator>> (Uint16 &data) |
| Packet & | operator>> (Int32 &data) |
| Packet & | operator>> (Uint32 &data) |
| Packet & | operator>> (float &data) |
| Packet & | operator>> (double &data) |
| Packet & | operator>> (char *data) |
| Packet & | operator>> (std::string &data) |
| Packet & | operator>> (wchar_t *data) |
| Packet & | operator>> (std::wstring &data) |
| Packet & | operator>> (String &data) |
| Packet & | operator<< (bool data) |
| Operator << overloads to put data into the packet. | |
| Packet & | operator<< (Int8 data) |
| Packet & | operator<< (Uint8 data) |
| Packet & | operator<< (Int16 data) |
| Packet & | operator<< (Uint16 data) |
| Packet & | operator<< (Int32 data) |
| Packet & | operator<< (Uint32 data) |
| Packet & | operator<< (float data) |
| Packet & | operator<< (double data) |
| Packet & | operator<< (const char *data) |
| Packet & | operator<< (const std::string &data) |
| Packet & | operator<< (const wchar_t *data) |
| Packet & | operator<< (const std::wstring &data) |
| Packet & | operator<< (const String &data) |
Friends | |
| class | SocketTCP |
| class | SocketUDP |
Packet wraps data to send / to receive through the network.
Definition at line 43 of file Packet.hpp.
| sf::Packet::Packet | ( | ) |
Default constructor.
Definition at line 39 of file Packet.cpp.
| sf::Packet::~Packet | ( | ) | [virtual] |
Virtual destructor.
Definition at line 50 of file Packet.cpp.
| void sf::Packet::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 59 of file Packet.cpp.
| void sf::Packet::Clear | ( | ) |
Clear the packet data.
Definition at line 73 of file Packet.cpp.
| bool sf::Packet::EndOfPacket | ( | ) | const |
Tell if the reading position has reached the end of the packet.
Definition at line 104 of file Packet.cpp.
| const char * sf::Packet::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 86 of file Packet.cpp.
| std::size_t sf::Packet::GetDataSize | ( | ) | const |
Get the size of the data contained in the packet.
Definition at line 95 of file Packet.cpp.
| sf::Packet::operator bool | ( | ) | const |
Return the validity of packet.
Tell if the packet is valid for reading.
Definition at line 113 of file Packet.cpp.
| Packet & sf::Packet::operator<< | ( | bool | data | ) |
Operator << overloads to put data into the packet.
Definition at line 311 of file Packet.cpp.
| Packet & sf::Packet::operator>> | ( | bool & | data | ) |
Operator >> overloads to extract data from the packet.
Definition at line 122 of file Packet.cpp.