Class Serializer

Inheritance Relationships

Derived Type

Class Documentation

class Serializer

Interface class for Serializer instances.

Subclassed by gpa::serialization::NetworkSerializer

Public Functions

virtual ~Serializer()
virtual size_t Write(void const *data, size_t nBytes) = 0

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

virtual size_t Read(void *data, size_t nBytes) = 0

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) = 0

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