A templated class to serialize and unserialize a packet (as a std::vector of bytes)
More...
#include <Serialization.hpp>
|
static std::vector< byte > | serialize (Serializable const &obj) |
| A method to serialize an object (the object passed as template argument) into a vector of byte. More...
|
|
static Serializable | unserialize (std::vector< byte > const &v) |
| A method to unserialize a vector of byte into an object (passed as template argument) More...
|
|
template<class Serializable>
struct serializable_trait< Serializable >
A templated class to serialize and unserialize a packet (as a std::vector of bytes)
- Template Parameters
-
Serializable | Type of Structure to handle |
◆ serialize()
template<class Serializable >
static std::vector<byte> serializable_trait< Serializable >::serialize |
( |
Serializable const & |
obj | ) |
|
|
inlinestatic |
A method to serialize an object (the object passed as template argument) into a vector of byte.
- Parameters
-
- Returns
- std::vector<byte> Serialized object
◆ unserialize()
template<class Serializable >
static Serializable serializable_trait< Serializable >::unserialize |
( |
std::vector< byte > const & |
v | ) |
|
|
inlinestatic |
A method to unserialize a vector of byte into an object (passed as template argument)
- Parameters
-
- Returns
- Serializable Unserialized object
The documentation for this struct was generated from the following file:
- /home/gurvan-le-letty/delivery/epitech_delivery/semester_5/B-CPP-500/B-CPP-500-PAR-5-1-rtype-martin.vanaud/Libraries/Network/Serialization/Serialization.hpp