Class NetworkSerializer

Inheritance Relationships

Base Type

Class Documentation

class NetworkSerializer : public gpa::serialization::Serializer

Serializer implementation over an existing network Endpoint.

Public Functions

NetworkSerializer(network::Endpoint *endpoint)

NetworkSerializer constructor.

Parameters

endpoint -- Existing, connected network Endpoint instance.

~NetworkSerializer()
virtual size_t Write(void const *data, size_t nBytes) override

Write data to any underlying storage or transport.

Parameters
  • data -- Pointer to data bytes to be written

  • nBytes -- Number of bytes to write

Returns

Number of bytes actually written

bool WaitRead(size_t nBytes)
virtual size_t Read(void *data, size_t nBytes) override

Read data from any underlying storage or transport.

Parameters
  • data -- Buffer to receive data bytes

  • nBytes -- Length of receive buffer, in bytes

Returns

NUmber of bytes actually read

virtual size_t Consume(size_t nBytes) override

Consume data from any underlying storage or transport.

Note

This method is functionally identical to Read(), without a receive buffer needed; it can be used to "skip over" a certain number of bytes of input during deserialization.

Parameters

nBytes -- Number of bytes to consume

Returns

Number of bytes actually consumed