Class to serialize and unserialize a packet (as a std::vector of bytes) with an id representing the type of data.
More...
#include <Serialization.hpp>
|
template<class Seriazable > |
static std::vector< byte > | serializeHeader (uint8_t id, Seriazable const &obj) |
| A method to serialize an object (the object passed as template argument) into a vector of byte with his type at front. More...
|
|
static uint8_t | getId (std::vector< byte > const &bytes) |
| Get the Id object from the bytes. More...
|
|
Class to serialize and unserialize a packet (as a std::vector of bytes) with an id representing the type of data.
◆ getId()
static uint8_t serialize_header::getId |
( |
std::vector< byte > const & |
bytes | ) |
|
|
inlinestatic |
Get the Id object from the bytes.
- Parameters
-
bytes | Unkwown type Serialized Object with an id representing his type at front |
- Returns
- uint8_t Id representing the type of Object contained in bytes
◆ serializeHeader()
template<class Seriazable >
static std::vector<byte> serialize_header::serializeHeader |
( |
uint8_t |
id, |
|
|
Seriazable const & |
obj |
|
) |
| |
|
inlinestatic |
A method to serialize an object (the object passed as template argument) into a vector of byte with his type at front.
- Template Parameters
-
Seriazable | Type of Structure to serialize |
- Parameters
-
id | Type of structure represented with an enum |
obj | Object to serialize |
- Returns
- std::vector<byte> Serialized 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