Boost logo

Boost Users :

Subject: Re: [Boost-users] Serialization of a std::vector< boost::shared_ptr< A> > throws unregistered_class exception
From: Benoit Gagnon (b.gagnon_at_[hidden])
Date: 2009-03-20 17:34:44


On Mar 20, 2:13 pm, Sohail Somani <soh..._at_[hidden]> wrote:
> Benoit Gagnon wrote:
> > On Mar 19, 10:26 am, Benoit Gagnon <b.gag..._at_[hidden]> wrote:
> >> On Mar 19, 9:58 am, "Robert Ramey" <ra..._at_[hidden]> wrote:
>
> >>> Depending on which version of boost you're using. You may have
> >>> to include a special macro - look into serialization/shared_ptr.hpp
> >>> at the end.
> >>> Robert Ramey
> >> I'm using Boost 1.34.1.
> >> The only macro I see in serialization/shared_ptr.hpp is
> >> BOOST_SERIALIZATION_SHARED_PTR.
>
> >> Am I missing something?
>
> > I still haven't figured this out, if anyone has clues...
> > Should I make a wrapper class around the std::vector and implement
> > serialization for it?
>
> Do you have BOOST_CLASS_EXPORT for each class that you are serializing
> by base class pointer? For example, Hospital. You should have something
> like:
>
> #include <boost/serialization/export.hpp>
>
> class Hospital ...;
>
> BOOST_CLASS_EXPORT(Hospital)

That did it, thank you!

>
> --
> Sohail Somanihttp://uint32t.blogspot.com
>
> _______________________________________________
> Boost-users mailing list
> Boost-us..._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