What happens if you try the following:

 

TestBase * pT1 = new TestType1;

TestBase* pT2 = new TestType2;

testOutXML << boost::serialization::make_nvp("pT1", pT1);

testOutXML << boost::serialization::make_nvp("pT2", pT2);

testTypeOFS.close();

delete pT1;

delete pT2;

...

testInXML >> boost::serialization::make_nvp("pT1", pTB);

testInXML >> boost::serialization::make_nvp("pT2", pTB);

Robert Ramey

"Daniel Roberts" <impulsionaudio@gmail.com> wrote in message news:14125aaf0812291340m10f590e7j4d43eecaeefe2a22@mail.gmail.com...

Yes, I understand that. I am sorry I should have been more clear; the base class is abstract. I am able to get the "unregistered class" exception in test_no_rtti.cpp, in load_derived, by removing the serializations using derived class pointers (which register the classes). When execution tries to serialize using the base class pointer, the "unregistered class" exception is thrown. I expect this to not happen because all the classes are registered using BOOST_CLASS_EXPORT. Could BOOST_CLASS_EXPORT not be working? Do you see this when commenting out the derived class serializations in load_derived?

Thanks,

Daniel Roberts


Only polymophic types can be serialized through a base class pointer.

Robert Ramey


_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users