Boost logo

Boost Users :

Subject: [Boost-users] [Serialization] unable to fix UNREGISTERED CLASS exception
From: David Graf (david.graf_at_[hidden])
Date: 2010-02-16 12:03:57


Hello Everybody

I am using boost serialization heavily in my project to serialize C++ objects. Unfortunately, I have a big problem when I when polymorphic pointers and non intrusive serialize functions are involved in the serialization.
Therefore, I made a little project which demonstrates my usage of boost functionality (see attachment). Basically, I have four classes which are derived in the following way: Item <- AtomicItem <- BooleanItem <- SpecialItem. SpecialItem contains an intrusive serialized functions. The other three contain non intrusive serialize functions.
In the main function (testing.cpp), I create a SpecialItem and the stack and assign it to a pointer to an Item. Then, I serialize that Item.

Unfortunately, it doesn't work. Only the serialize function of the class Item is invoked. Can you please tell me what I did wrong in my example?

Note:
The example can be compiled with the command: g++ atomic_items_serialization.cpp testing.cpp -o testing -lboost_serialization-mt
And the expected result is:
serializing Item
serializing AtomicItem
serializing BooleanItem
serializing SpecialItem

Thanks in advance

David




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