HomePhabricator

overhaul serialization code
3d796f899628Unpublished

Unpublished Commit ยท Learn More

Repository Importing: This repository is still importing.

Description

overhaul serialization code

The implementation of each class' serialization/deserialization is no longer
passed within a macro. The implementation now lies within a template of form:

template <typename T, typename Stream, typename Operation>
inline static size_t SerializationOp(T thisPtr, Stream& s, Operation ser_action, int nType, int nVersion) {

size_t nSerSize = 0;
/* CODE */
return nSerSize;

}

In cases when codepath should depend on whether or not we are just deserializing
(old fGetSize, fWrite, fRead flags) an additional clause can be used:
bool fRead = boost::is_same<Operation, CSerActionUnserialize>();

The IMPLEMENT_SERIALIZE macro will now be a freestanding clause added within
class' body (similiar to Qt's Q_OBJECT) to implement GetSerializeSize,
Serialize and Unserialize. These are now wrappers around
the "SerializationOp" template.

Details

Provenance
Kamil Domanski <kdomanski@kdemail.net>Authored on Aug 20 2014, 06:42
deadalnixPushed on May 14 2017, 22:04
Parents
rABC9f3d47677973: changed field types in some structures to equivalent unambiguous types
Branches
Unknown
Tags
Unknown

Event Timeline

Kamil Domanski <kdomanski@kdemail.net> committed rABC3d796f899628: overhaul serialization code (authored by Kamil Domanski <kdomanski@kdemail.net>).Aug 31 2014, 00:14