4 #ifndef _3ESCOLLATEDPACKET_H_ 5 #define _3ESCOLLATEDPACKET_H_ 9 #include "3esconnection.h" 10 #include "3espacketheader.h" 14 struct CollatedPacketMessage;
15 struct CollatedPacketZip;
89 bool compressionEnabled()
const;
99 unsigned maxPacketSize()
const;
120 int add(
const uint8_t *buffer, uint16_t byteCount);
131 const uint8_t *buffer(
unsigned &byteCount)
const;
135 unsigned collatedBytes()
const;
142 void close()
override;
146 void setActive(
bool active)
override;
150 bool active()
const override;
154 const char *address()
const override;
158 uint16_t port()
const override;
162 bool isConnected()
const override;
167 int create(
const Shape &shape)
override;
172 int destroy(
const Shape &shape)
override;
177 int update(
const Shape &shape)
override;
182 int updateTransfers(
unsigned byteLimit)
override;
187 int updateFrame(
float dt,
bool flush =
true)
override;
191 unsigned referenceResource(
const Resource *resource)
override;
195 unsigned releaseResource(
const Resource *resource)
override;
206 int send(
const uint8_t *data,
int byteCount)
override;
213 void init(
bool compress,
unsigned bufferSize,
unsigned maxPacketSize);
217 static void expand(
unsigned expandBy, uint8_t *&buffer,
unsigned &bufferSize,
unsigned currentDataCount,
unsigned maxPacketSize);
219 CollatedPacketZip *_zip;
221 uint8_t *_finalBuffer;
223 unsigned _bufferSize;
224 unsigned _finalBufferSize;
225 unsigned _finalPacketCursor;
227 unsigned _maxPacketSize;
235 return _zip !=
nullptr;
241 return _maxPacketSize;
251 #endif // _3ESCOLLATEDPACKET_H_ A base class for encapsulating a shape which is to be represented remotely.
Definition: 3esshape.h:39
Defines the interfaces for a client connection.
Definition: 3esconnection.h:19
static const unsigned InitialCursorOffset
Initial cursor position in the write buffer.
Definition: 3escollatedpacket.h:59
Information about the server.
Definition: 3esmessages.h:160
Definition: 3esbounds.h:13
unsigned maxPacketSize() const
Return the capacity of the collated packet.
Definition: 3escollatedpacket.h:239
The Resource base class defines an interface for any resource used by Shape objects such as MeshSet...
Definition: 3esresource.h:34
static const size_t Overhead
Byte count overhead added by using a CollatedPacket.
Definition: 3escollatedpacket.h:56
static const uint16_t MaxPacketSize
The default packet size limit for a CollatedPacketMessage.
Definition: 3escollatedpacket.h:61
A utility class which generates a MtCollatedPacket message by appending multiple other messages...
Definition: 3escollatedpacket.h:51
A utility class for writing payload data to a PacketHeader.
Definition: 3espacketwriter.h:34
bool compressionEnabled() const
Is compression enabled.
Definition: 3escollatedpacket.h:233
unsigned collatedBytes() const
Return the number of bytes that have been collated.
Definition: 3escollatedpacket.h:245