Serialization of derived classes

1 view
Skip to first unread message

Sebastian Mayer

unread,
Aug 4, 2011, 7:49:17 AM8/4/11
to SpoVNet
Hi,

I've got a list<A*> that contains pointers to objects of type B,
C, ..., which inherit from A. If I serialize this list as in the
Serialization Tutorial, after deserialization the objects in the list
are all of type A.
What might be the problem?

Sebastian Mies

unread,
Aug 4, 2011, 7:52:11 AM8/4/11
to spo...@googlegroups.com
Hi!

Inheritance is not supported, as the serialization
does not transfer any type information automatically!

Best regards,

Sebastian

--
Karlsruher Institut für Technologie (KIT)
Institut für Telematik

Sebastian Mies
Wissenschaftlicher Mitarbeiter

Zirkel 2
Gebäude 20.20
76131 Karlsruhe

Telefon: +49 721 608-46416
Fax: +49 721 608-46789
E-Mail: mi...@kit.edu

Reply all
Reply to author
Forward
0 new messages