Skip to content

Improvements for encoding, serialization and NetworkSocket

Philipp Seiwald requested to merge improvements_io_serialization into dev-v2

Various improvements for the io::encoding and io::serialization modules. Moreover, the NetworkSocket got a major upgrade to support large object transmission (TCP) + better error handling and overall performance.

New Features

  • [io]:
    • encoding
      • Now supports encoding and decoding of SmartVector containers
      • Now supports encoding and decoding of generic Eigen::QuaternionBase (arbitrary scalar type)
    • serialization
      • Now supports serialization and deserialization of std::vector, SmartVector, Eigen::MatrixBase and Eigen::QuaternionBase types
    • SerializableData
      • Added support for serialize(SerializableData) and deSerialize(SerializableData). This allows embedded SerializableData-objects in containers like arrays or vectors.
    • NetworkSocket
      • Now supports messages >4kB for TCP connections (theoretical maximum is now 4GB)
      • Now avoids overflow of TCP and UDP socket buffers (handled by OS kernel)
      • Improved error handling for sending and receiving messages
      • Improved constructor by dedicated container for options

Breaking Changes

  • [io]:
    • serialization:
      • Changed syntax from serializeArray() to serialize() and deSerializeArray() to deSerialize()
      • Changed syntax from serializeString() to serialize() and deSerializeString() to deSerialize()
      • Moved SerializableData into serialization.hpp (and namespace serialization). This is necessary to allow automatic serialization of containers like array, vector, SmartVector with the element type SerializableData
      • Changed syntax from serialize(stream, stream) to append(stream, stream) to avoid ambiguity with serialization of an std::vector<uint8_t>
    • NetworkSocket
      • Constructor now expects a container of options (NetworkSocketOptions or the derived specializations TCPServerOptions, TCPClientOptions, UDPSocketOptions)
Edited by Philipp Seiwald

Merge request reports