refactor(io): create macro to register session serialization and deserialization
Description
We would like to improve the registration (i.e filling up the serializer ad deserializer registry, which is a map composed of a class and its serialization or deserialization function).
As for now, there is a hardcoded map of de/serializers for all sight::data
classes, and when there is a need to register new data we need to manually call setDefaultSerializer
and setDefaultDeserializer
which can lead to unnecessary additional code.
Proposal
The idea would be to remove the hardcoded list, and create a macro, for example, SIGHT_REGISTER_SERIALIZER
, in each sight::io::session::details
to do the registration. Or have a separate file that does the call for the macro for all data classes.
Functional specifications
see proposal
Technical specifications
- Create
SIGHT_REGISTER_SERIALIZER
macro inio/session/Macros.hpp
- rename all io/session file extensions from
hpp
intohxx
- rename
setDefaultSerializer
intosetSerializer
andsetSerializer
intosetCustomSerializer
Test plan
All session tests should pass