David Graf wrote:
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?
I believe that taking the non_intrusive functions out of the namespace boost::serialization might work better. It seems to me that things should work as you have it, but I would have to look into it in more detail. Robert Ramey
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 mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users