|
Boost Users : |
From: Alex Idar (alex.idar_at_[hidden])
Date: 2008-03-30 17:41:16
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
____________________________________________________________________________________
You rock. That's why Blockbuster's offering you one month of Blockbuster Total Access, No Cost.
http://tc.deals.yahoo.com/tc/blockbuster/text5.com
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net