Boost logo

Boost Users :

Subject: [Boost-users] [serialization] deserialized instance empty even though proper serialize methods called
From: Hickman, Steve (AdvTech) (Steve.Hickman_at_[hidden])
Date: 2014-05-29 09:07:08


I'm using Boost.Serialization (v 1.55) on a 64 bit Win7 machine using VS 2012. I'm building the library containing all the classes to be serialized as a DLL. None of the classes have manually defined constructors (so I'm getting the compiler created constructors). All serialization is done through pointers. Most of the classes for a single class hierarchy of up to 5 inheritance levels, although there is a second class hierarchy with only 2 levels and a number of classes that do not use inheritance.

When running tests where the same EXE serializes then deserializes everything works (I'm serializing to/from XML, text and binary). When running tests where I serialize in one EXE then deserialize in another EXE, (using text archives on both sides) the serialization works fine and the deserialization appears to work fine (all the appropriate deserialize methods are called), but the resulting object contains none of the data. The data is arriving at the receiving/deserializing application as a string which is then placed in a stringstream and that is used to initialize a text_iarchive.

The serialize methods use BOOST_SERIALIZATION_NVP since this is set up to handle XML as well. After each line such as this:
   ar & BOOST_SERIALIZATION_NVP(valid);

I would expect the referent member variable to be set, but it does not change. Nor has anything changed when examining the created instance after deserialization has completed.

What is could be causing this/ how do I fix it?

Steve Hickman
System Architect, Flight Deck of the Future
480-236-8367



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