|
Boost Users : |
From: Tim St. Clair (timothysc_at_[hidden])
Date: 2007-11-01 10:11:49
I've encountered the same issue(s) in the past where signals will be
raised when the data serialized is nothing close to what is expected.
I have been able to deal with it is by doing one, or all, of the following:
Derive all types which are "Serializable" from common base, then
always try to unserialize to<->from that base. From there,
switch/vector on the derived type, either through RTTI or some other
mechanism.
I would also recommend overloading the sig_hdlr, so you can
gracefully shutdown in case something runs-a-muck.
Hope this helps,
-Tim
On 11/1/07, Christoph <christoph.duelli_at_[hidden]> wrote:
> I am experimenting with Boost.Serialization.
> I tried to de-serialize a (binary) file written for a *different* class.
> Obviously, this can not work.
>
> However, there is not thrown an exception.
> Question: (How) can I determine that the reading failed?
> (In case of corrupted or non-matching archives.)
>
> (I have attached a small demo.)
>
> Best regards
> Christoph
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>
>
-- Regards, Timothy St. Clair [timothysc_at_[hidden]]
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