Skip to content

Class cerializer::StreamHandler

template <typename T>

ClassList > cerializer > StreamHandler

A class for handling both serialization and deserialization on a single stream. More...

  • #include <serializer.hpp>

Public Functions

Type Name
void ParseStream (std::function< void(std::unique_ptr< Type > &)> callback)
Parses the input stream and invokes a callback for each complete message found.
StreamHandler (T & stream)
Constructs a StreamHandler .
void Write (const Message< M, U, Fs... > & message)
Writes a message to the stream.

Detailed Description

This class provides a convenient wrapper around a Serializer and a Deserializer, allowing for easy reading and writing of messages from the same IOAble stream.

Template parameters:

  • T The type of the stream, which must satisfy the IOAble concept.

Public Functions Documentation

function ParseStream

Parses the input stream and invokes a callback for each complete message found.

template<std::derived_from< BasePacket > Type>
inline void cerializer::StreamHandler::ParseStream (
    std::function< void(std::unique_ptr< Type > &)> callback
) 

See also: Deserializer::ParseStream


function StreamHandler

Constructs a StreamHandler .

inline cerializer::StreamHandler::StreamHandler (
    T & stream
) 

Parameters:

  • stream The stream to read from and write to.

function Write

Writes a message to the stream.

template<typename M, uint8_t U, typename... Fs>
inline void cerializer::StreamHandler::Write (
    const Message < M, U, Fs... > & message
) 

See also: Serializer::Write



The documentation for this class was generated from the following file serializer.hpp