10#define WRITE_ON_BIN(data, valuePtr, size, sizeBuffer) sizeBuffer = size;\
11 data->write((const char*)&sizeBuffer, sizeof(sizeBuffer));\
12 data->write((const char*)valuePtr, size);
14#define READ_FROM_BIN(data, destPtr, sizeBuffer) data->read((char*)&sizeBuffer, sizeof(int));\
15 data->read((char*)destPtr, sizeBuffer);
36 int virtual Serialize(std::fstream* data,
int offset) {
return -1; }
44 int virtual Deserialize(std::fstream* data,
int offset) {
return -1; }
Base class for serialization and deserialization.
Definition Serialization.h:23
virtual int Deserialize(std::fstream *data, int offset)
Deserialize the object from the file.
Definition Serialization.h:44
Serialized()
Default constructor for Serialized class.
Definition Serialization.h:28
virtual int Serialize(std::fstream *data, int offset)
Serialize the object and write it to the file.
Definition Serialization.h:36