Wrath of Zeus
Made by Torchlight Games for CSE 125 SP24
Loading...
Searching...
No Matches
Namespaces | Functions
serialize.hpp File Reference
#include <string>
#include <sstream>
#include <glm/glm.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>

Go to the source code of this file.

Namespaces

namespace  boost
 
namespace  boost::serialization
 

Functions

template<class Type >
std::string serialize (const Type &obj)
 
template<class Type >
Type deserialize (std::string data)
 
template<class Archive >
void boost::serialization::serialize (Archive &ar, glm::vec3 &vec, const unsigned int version)
 

Function Documentation

◆ deserialize()

template<class Type >
Type deserialize ( std::string  data)

Helper function to easily deserialize a string received over the network into a obj.

Parameters
dataString representation of a serialized obj recieved across the network.

◆ serialize()

template<class Type >
std::string serialize ( const Type &  obj)

Helper function to easily serialize a packet/events's data into a string to send over the network.

Parameters
objobject that you want to serialize to send across the network. This should not include any header information, it should strictly be a struct for packet data.