10 const std::string& header,
11 std::vector<irsol::types::byte_t>&& payload)
12 : header(header), payload(std::move(payload))
35 std::ostringstream oss;
36 oss <<
"SerializedMessage{"
37 <<
"header: '" <<
header <<
"'";
39 oss <<
", payload size: " <<
payload.size() <<
"bytes";
41 oss <<
", no payload";
Defines the SerializedMessage structure representing serialized protocol messages.
std::vector< irsol::types::byte_t > payload
The binary payload of the serialized message.
std::string header
The textual header of the serialized message.
bool hasHeader() const
Checks whether the serialized message contains a non-empty header.
std::string toString() const
Converts the serialized message to a string representation.
size_t payloadSize() const
Returns the size of the payload in bytes.
bool hasPayload() const
Checks whether the serialized message contains a non-empty payload.
SerializedMessage(const std::string &header, std::vector< irsol::types::byte_t > &&payload)
Constructs a SerializedMessage with a header and binary payload.