-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathData.hpp
54 lines (44 loc) · 1.81 KB
/
Data.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Data.hpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: jmartin <[email protected]> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/11/08 15:22:42 by jmartin #+# #+# */
/* Updated: 2022/11/08 15:22:42 by jmartin ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef DATA_HPP
# define DATA_HPP
# define GREEN "\033[1;32m"
# define RED "\033[1;31m"
# define ORANGE "\033[1;33m"
# define CYAN "\033[1;36m"
# define GREY "\033[1;37m"
# define NC "\033[0m"
# include <iostream>
# include <string>
/*
* Serialization is the process of translating data structures
* or object state into a format that can be stored
* (for example, in a file or memory buffer, or transmitted across a network connection link)
* and reconstructed later in the same or another computer environment.
*
* The opposite process is called deserialization.
*/
class Data
{
public:
Data(void);
Data(Data const &instance);
~Data(void);
Data & operator=(Data const & rhs);
std::string getValue(void) const;
void setValue(std::string value);
private:
std::string _value;
};
uintptr_t serialize(Data* ptr); // serialize the data
Data *deserialize(uintptr_t raw); // return a pointer to a Data instance
#endif