25 #ifndef SFML_PACKET_HPP
26 #define SFML_PACKET_HPP
31 #include <SFML/Network/Export.hpp>
50 typedef bool (
Packet::*BoolType)(std::size_t);
77 void append(
const void* data, std::size_t sizeInBytes);
102 const void* getData()
const;
115 std::size_t getDataSize()
const;
129 bool endOfPacket()
const;
171 operator BoolType()
const;
177 Packet& operator >>(
bool& data);
178 Packet& operator >>(Int8& data);
179 Packet& operator >>(Uint8& data);
180 Packet& operator >>(Int16& data);
181 Packet& operator >>(Uint16& data);
182 Packet& operator >>(Int32& data);
183 Packet& operator >>(Uint32& data);
184 Packet& operator >>(
float& data);
185 Packet& operator >>(
double& data);
186 Packet& operator >>(
char* data);
187 Packet& operator >>(std::string& data);
188 Packet& operator >>(
wchar_t* data);
189 Packet& operator >>(std::wstring& data);
196 Packet& operator <<(
bool data);
197 Packet& operator <<(Int8 data);
198 Packet& operator <<(Uint8 data);
199 Packet& operator <<(Int16 data);
200 Packet& operator <<(Uint16 data);
201 Packet& operator <<(Int32 data);
202 Packet& operator <<(Uint32 data);
203 Packet& operator <<(
float data);
204 Packet& operator <<(
double data);
205 Packet& operator <<(
const char* data);
206 Packet& operator <<(
const std::string& data);
207 Packet& operator <<(
const wchar_t* data);
208 Packet& operator <<(
const std::wstring& data);
234 virtual const void* onSend(std::size_t& size);
253 virtual void onReceive(
const void* data, std::size_t size);
261 bool operator ==(
const Packet& right)
const;
262 bool operator !=(
const Packet& right)
const;
274 bool checkSize(std::size_t size);
279 std::vector<char> m_data;
280 std::size_t m_readPos;
287 #endif // SFML_PACKET_HPP