Boost logo

Boost Users :

From: Manuel Jung (gzahl_at_[hidden])
Date: 2007-06-18 05:44:22


Hi,

I still got some starting problems with the boost::serialization library.
I want to serialize a shared_ptr to my own polymorphic class.
I'm building my own networkprotocol and the basic idea is a kind
of "header"-class which with a shared_ptr<data_base> which can point to a
lot of different data structs, which are polymorphic children of data_base.

This "header"-class is then serialized and send to another peer. But how
should this peer get the real type from the shared_ptr<data_base>? Which
child is it pointing to? I can get the name with "typeid()", but i cannot
get the type through that way. I would like to get the type from it
automaticly without using some case-conditions, so i only have to add a new
child of data_base and can use it, without changing any networkprotocol
related code.

Kind Regards
Manuel Jung


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