CPP06 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
Serializer.hpp
[詳解]
1/* ************************************************************************** */
2/* */
3/* ::: :::::::: */
4/* Serializer.hpp :+: :+: :+: */
5/* +:+ +:+ +:+ */
6/* By: kamitsui <kamitsui@student.42tokyo.jp> +#+ +:+ +#+ */
7/* +#+#+#+#+#+ +#+ */
8/* Created: 2025/07/22 14:38:23 by kamitsui #+# #+# */
9/* Updated: 2025/07/23 01:18:55 by kamitsui ### ########.fr */
10/* */
11/* ************************************************************************** */
12
18#ifndef SERIALIZER_HPP
19#define SERIALIZER_HPP
20
21#include "Data.hpp"
22#include <stdint.h> // For uintptr_t
23
31 public:
32 static uintptr_t serialize(Data *ptr);
33
34 static Data *deserialize(uintptr_t raw);
35
36 private:
37 // Private members to prevent instantiation.
38 Serializer();
39 Serializer(const Serializer &src);
40 Serializer &operator=(const Serializer &rhs);
42};
43
44#endif
Contains the definition of the Data struct.
A static class to serialize and deserialize a Data pointer.
static uintptr_t serialize(Data *ptr)
Converts a Data pointer to a uintptr_t integer.
static Data * deserialize(uintptr_t raw)
Converts a uintptr_t integer back to a Data pointer.
A simple data structure for serialization testing.
Definition Data.hpp:29