LDMX-Software / fire

Event-by-event processing framework using HDF5 and C++17
https://ldmx-software.github.io/fire/
GNU General Public License v3.0
1 stars 0 forks source link

Schema Evolution of Event Object Types #41

Closed tomeichlersmith closed 2 years ago

tomeichlersmith commented 2 years ago

Is your feature request related to a problem? Please describe. If a user wants to update an event object but still retain the ability to read data files written with the old version.

Describe the solution you'd like Both ROOT and Boost.Serialization have a method for versioning the class that is being serialized. Adopting this macro-style versioning scheme would be appropriate.

tomeichlersmith commented 2 years ago

The BOOST_CLASS_VERSION macro simply defines a full-specialization of a backend template struct with the default value of 0. This would be pretty easy to pull into our framework for serialization.

The BOOST_SERIALIZATION_SPLIT_MEMBER macro may also be of use. It generates member functions so that reading- and writing-specific functions are called instead of the blanket attach method. This could be helpful for optionally-reading new members (depending on version of file) but still being able to write the new members.