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 >>(Int64& data);
185 Packet& operator >>(Uint64& data);
186 Packet& operator >>(
float& data);
187 Packet& operator >>(
double& data);
188 Packet& operator >>(
char* data);
189 Packet& operator >>(std::string& data);
190 Packet& operator >>(
wchar_t* data);
191 Packet& operator >>(std::wstring& data);
198 Packet& operator <<(
bool data);
199 Packet& operator <<(Int8 data);
200 Packet& operator <<(Uint8 data);
201 Packet& operator <<(Int16 data);
202 Packet& operator <<(Uint16 data);
203 Packet& operator <<(Int32 data);
204 Packet& operator <<(Uint32 data);
205 Packet& operator <<(Int64 data);
206 Packet& operator <<(Uint64 data);
207 Packet& operator <<(
float data);
208 Packet& operator <<(
double data);
209 Packet& operator <<(
const char* data);
210 Packet& operator <<(
const std::string& data);
211 Packet& operator <<(
const wchar_t* data);
212 Packet& operator <<(
const std::wstring& data);
238 virtual const void* onSend(std::size_t& size);
257 virtual void onReceive(
const void* data, std::size_t size);
265 bool operator ==(
const Packet& right)
const;
266 bool operator !=(
const Packet& right)
const;
278 bool checkSize(std::size_t size);
283 std::vector<char> m_data;
284 std::size_t m_readPos;
285 std::size_t m_sendPos;
292 #endif // SFML_PACKET_HPP