41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* Serializer.hpp :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: aortigos <aortigos@student.42malaga.com> +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2026/02/28 23:48:07 by aortigos #+# #+# */
|
|
/* Updated: 2026/02/28 23:48:07 by aortigos ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef SERIALIZER_HPP
|
|
|
|
# define SERIALIZER_HPP
|
|
|
|
# include <iostream>
|
|
# include <stdint.h>
|
|
|
|
struct Data
|
|
{
|
|
int age;
|
|
std::string name;
|
|
};
|
|
|
|
class Serializer
|
|
{
|
|
private:
|
|
Serializer();
|
|
Serializer(const Serializer &other);
|
|
Serializer& operator=(const Serializer &other);
|
|
~Serializer();
|
|
|
|
public:
|
|
static uintptr_t serialize(Data *ptr);
|
|
static Data *deserialize(uintptr_t raw);
|
|
|
|
};
|
|
|
|
#endif
|