aboutsummaryrefslogtreecommitdiff
path: root/src/serializer.h
blob: 03e682035ba1c6a0e6084f029b210153e8ee1f62 (plain)
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
55
56
57
58
59
60
61
62
63
64
#ifndef SERIALIZABLE_H
#define SERIALIZABLE_H

#include <stdint.h>
//#include "serializable.h"

class Serializer
{
private:
	bool bLoading;
public:
	bool isLoading();
	
	Serializer(bool bLoading);
	virtual ~Serializer();
	virtual void close()=0;

	virtual Serializer &operator<<(bool)=0;
	virtual Serializer &operator<<(int8_t)=0;
	virtual Serializer &operator<<(int16_t)=0;
	virtual Serializer &operator<<(int32_t)=0;
	virtual Serializer &operator<<(int64_t)=0;
	virtual Serializer &operator<<(uint8_t)=0;
	virtual Serializer &operator<<(uint16_t)=0;
	virtual Serializer &operator<<(uint32_t)=0;
	virtual Serializer &operator<<(uint64_t)=0;
	virtual Serializer &operator<<(float)=0;
	virtual Serializer &operator<<(double)=0;
	virtual Serializer &operator<<(long double)=0;

	virtual Serializer &operator>>(bool &)=0;
	virtual Serializer &operator>>(int8_t &)=0;
	virtual Serializer &operator>>(int16_t &)=0;
	virtual Serializer &operator>>(int32_t &)=0;
	virtual Serializer &operator>>(int64_t &)=0;
	virtual Serializer &operator>>(uint8_t &)=0;
	virtual Serializer &operator>>(uint16_t &)=0;
	virtual Serializer &operator>>(uint32_t &)=0;
	virtual Serializer &operator>>(uint64_t &)=0;
	virtual Serializer &operator>>(float &)=0;
	virtual Serializer &operator>>(double &)=0;
	virtual Serializer &operator>>(long double &)=0;
	
	/*
	virtual Serializer &operator&(bool &);
	virtual Serializer &operator&(int8_t &);
	virtual Serializer &operator&(int16_t &);
	virtual Serializer &operator&(int32_t &);
	virtual Serializer &operator&(int64_t &);
	virtual Serializer &operator&(uint8_t &);
	virtual Serializer &operator&(uint16_t &);
	virtual Serializer &operator&(uint32_t &);
	virtual Serializer &operator&(uint64_t &);
	virtual Serializer &operator&(float &);
	virtual Serializer &operator&(double &);
	virtual Serializer &operator&(long double &);
	*/

	virtual Serializer &operator<<(class Serializable &);
	virtual Serializer &operator>>(class Serializable &);
	//virtual Serializer &operator&(Serializable &);
};

#endif