Boost Users :
Subject: [Boost-users] Class version exception during load
From: Andrew Swerlick (andrew.swerlick_at_[hidden])
Date: 2011-09-26 22:51:45
I'm trying to create a class with built in save and load methods that
handles serializing and deserializing data to disk to persist the class.
I've been able to get the save working, but I'm having some trouble with the
load. I getting the below error.
error: Failure in UserObjectSerialization: Unhandled exception: class
I've done some googling on it and can't find any documentation that seems to
apply in my situation. I'm not using any of the versioning features built
into boost, as this is mostly an experiment to get familar with the library.
The error is happening inside of a basic c++ Unit Test, copied below
boost::posix_time::ptime time = userobj.GetCreatedOn();
ia >> loadedUserObj;
The save method of the user object looks like this
// write class instance to archive
oa << this;
// archive and stream closed when destructors are called
The error is being thrown on the line "ia >> loadedUserObj" of the test
I can provide the full include and class definition file for the UserObject
class if needed, but I didn't want to clutter up my message if it wasn't
necessary. I can also post the contents of one of the files created during
a sucessful save.
Does anyone have any advice on how to deal with this error? Thanks for your
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