-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSerializable.h
39 lines (30 loc) · 877 Bytes
/
Serializable.h
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
/*
* Serializable.h
*
* Created on: Aug 16, 2019
* Author: sakex
*/
#ifndef SERIALIZER_SERIALIZABLE_H_
#define SERIALIZER_SERIALIZABLE_H_
#include <string>
/// Serializer namespace
namespace Serializer {
/// Serializable abstract class, implement to use to_file()
class Serializable {
public:
Serializable() = default;
virtual ~Serializable() = default;
/**
* Convert Serializable to string
* @return string representation of the Serializable
*/
std::string to_string() const;
private:
/**
* Pure virtual method to implement to convert Serializable to string
* @return string representation of the Serializable
*/
virtual std::string parse_to_string() const = 0;
};
} /* namespace Serializer */
#endif /* SERIALIZER_SERIALIZABLE_H_ */