R-Type  2
Doom but in better
Loading...
Searching...
No Matches
GameMessage.cpp File Reference
#include "GameMessage.hpp"
Include dependency graph for GameMessage.cpp:

Go to the source code of this file.

Functions

void serialize (const GameMessage &message, std::ostringstream &os)
 Serializes a GameMessage object into a binary stream.
 
GameMessage deserialize (std::istringstream &is)
 Deserializes a GameMessage object from a binary stream.
 

Function Documentation

◆ deserialize()

GameMessage deserialize ( std::istringstream & is)

Deserializes a GameMessage object from a binary stream.

This function reads binary data from the provided input stream and reconstructs a GameMessage object. The binary data should have been written using the serialize function.

Parameters
isThe input stream from which the binary data will be read.
Returns
GameMessage The reconstructed GameMessage object.

Definition at line 54 of file GameMessage.cpp.

◆ serialize()

void serialize ( const GameMessage & message,
std::ostringstream & os )

Serializes a GameMessage object into a binary stream.

This function writes the GameMessage object's data to the provided output stream in binary format. The serialized data can later be read using the deserialize function.

Parameters
messageThe GameMessage object to serialize.
osThe output stream to which the binary data will be written.

Definition at line 3 of file GameMessage.cpp.