Hi there.
 
I am looking for ideas about automatically generating the serialization helpers. Boost serialization library would be used - the question is about a simple (hopefully) and foolproof way of automatically creating the helpers.
 
The classed that need serialization are modified on a daily basis by other developers. Maintaining the serialization code manually isn't an option - looking for an automated way.
 
One possible approach:
1) Run a parser that scans the C++ code and identifies the data members of the classes that declare serialize()
2) Generate .inl files (one for each class to be serialized) with the boost::serialize() methods
3) Include the .inl files in the corresponding .cpps
4) Compile and link...
 
An idea thrown by someone was to get the data members by getting the symbols from the .obj files - but this would require two compiles - one to generate the object files from where the symbols would be extracted, then another one...
 
Definitely someone else had solved this problem (with the above approach or a different one). Please let me know your opinions.
 
Regards,

Alex


Like movies? Here's a limited-time offer: Blockbuster Total Access for one month at no cost.