Boost logo

Boost Users :

From: Jerry (jerry_at_[hidden])
Date: 2008-03-11 08:21:50


Hi,

boost::serialization is wonderful. It has saved a massive amount of effort when adding XML based storage to an existing C++ drawing library. A very big thank you to the author and the team.

Questions arising:

1. After one or two crash & burn cycles i discovered the need to register derived classes in the 'save through a virtual base class pointer' scenario. Right now this is done when saving to/loading from the archive. Is there an alternative to this method that ensures registration occurs automatically? i'm sure this is a FAQ but cannot find a definitive answer.

i..e

// XML archive
 boost::archive::xml_iarchive ia(ifs);
// ensure derived types are registered - too easy to forget, what's the better way?
 ia.register_type(static_cast<CDiagramButton*>(NULL));

2. Serializing to a binary storage should be a great way to implement undo/redo and clipboard functionality - has anyone found fame and fortune doing this?

Cheers

Jerry.



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