I'm looking for a C++ object persistence library to replace the Eternity library that I've been prototyping with for about a day. The Eternity library came up short.
I've created an object hierarchy similar to this:
I have an std::list
of ArchiveJob*
's that I'd like to persist and restore in XML format. Each ArchiveJob
has various child objects, some allocated on the stack, some on the heap.
Eternity did a good job of persisting these objects correctly, but it failed when restoring them.
(for those familiar with Eternity, the following "restore" operation failed to read any data from the XML file)
xml_read( sequence<pointers>(), *pList, pList->begin(), xml, "ScheduleList" );
This call allocated memory for the ArchiveJob
object, but all its children were uninitialized.
Can someone recommend an object hierarchy persistence solution that:
- Can persist / restore STL containers
- Is windows developer friendly (e.g. if it needs built, does it have a VS200x solution file)
- Can handle complex object hierarchies
Should I spend time learning XML serialization with boost? How does it handle complex object hierarchies stored in a master object in an STL container?
Boost Serialization is what you need:
[EDIT] actually I was wrong, it includes VS7.1 solution file