Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization]Can not export polymorphic types
From: Robert Ramey (ramey_at_[hidden])
Date: 2008-12-29 15:17:55


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

Robert Ramey
  "Daniel Roberts" <impulsionaudio_at_[hidden]> wrote in message news:14125aaf0812291113x1e0bdaa6qb39081e644eca000_at_mail.gmail.com...
  I made my own test program similar to test_no_rtti.cpp, only simpler. I have one base class and two classes that derive from it. All three classes are registered using BOOST_CLASS_EXPORT. I create an instance of each derived class and serialize them to an xml file. I then reload the file and try to serialize to a base class pointer and an "unregistered class" exception is thrown. I have stepped through my code and most of the boost serialization code and can not find a problem. The xml file looks good after creation but for some reason boost can not serialize it in properly. I have attached my short program. Can someone please tell me what I am doing wrong?
  Many thanks,
  Daniel Roberts

------------------------------------------------------------------------------

  _______________________________________________
  Boost-users mailing list
  Boost-users_at_[hidden]
  http://lists.boost.org/mailman/listinfo.cgi/boost-users



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