issues with BOOST_CLASS_EXPORT

I'm serializing two different classes (fooA, fooB) using boost::any using a wrapper template class combined with a handmade NVP (for the type) under boost_1_42_0. Serializing every type multiple times works fine. However if i use BOOST_CLASS_EXPORT (fooA) to register the type, after the SECOND call that type (fooA) is not being serialized properly anymore. Any subsequent serialization fails. the (text)archive of the correct case: 22 serialization::archive 7 4 fooA 0 0 10 4 fooB 0 0 1.5 4 fooB 2.5 4 fooA 20 the (text)archive of the broken case: 22 serialization::archive 7 4 fooA 1 0 0 10 4 fooB 0 0 1.5 4 fooB 2.5 4 fooA 0 Does that make sense to anybody ? Maybe a bug ? Note also that in the 'broken' case the archive is split into three lines instead of one. Sorry for not posting the example code but it's quite lengthy. If neccesary i'll do so. To put you in a bigger context: i'd like to serialize types using sockets across different architectures (different typeids who'd have guessed). I don't know the order in which the types are sent, so i guess i should register the types upfront using BOOST_CLASS_EXPORT to make sure save and load are in sync on any arch at any time. Please correct me here if i'm wrong and don't need to use the export. Sincerely Lukas Diduch

Lukas Diduch wrote:
I'm serializing two different classes (fooA, fooB) using boost::any using a wrapper template class combined with a handmade NVP (for the type) under boost_1_42_0.
Serializing every type multiple times works fine. However if i use BOOST_CLASS_EXPORT (fooA) to register the type, after the SECOND call that type (fooA) is not being serialized properly anymore. Any subsequent serialization fails.
Looks like default tracking is being used. We woul have to see the test program. Robert Ramey

On Thu, Apr 15, 2010 at 07:52:32PM -0400, Robert Ramey wrote:
Looks like default tracking is being used. We woul have to see the test program.
Sure, code is attached. Please note the NVP and wo_base wrapper are used for boost::any. I'm aware both are a duplication of the NVP created by the serialization framework as well as the wrapper used by boost::any. I've tried using interna from any directly (using def BOOST_NO_MEMBER_TEMPLATE_FRIENDS accessing holder) but failed with that approach because of any's constructor. Maybe there's a way to do this whole thing easier i've just missed, but that's another discussion. Sincerely Lukas Diduch

Any recent progress on this topic ? I did send some example code with my last post, so just wandering. Sincerely Lukas Diduch
participants (2)
-
Lukas Diduch
-
Robert Ramey