Boost logo

Boost Users :

Subject: [Boost-users] [Serialization] 1.56.0 - How to serialize polymorphic base class data without derived data
From: Todd Seiler (todd.seiler_at_[hidden])
Date: 2014-08-19 21:04:14


Basically, I'm looking to serialize a base class that's polymorphic, from a
base class pointer, without it calling the derived class's serialize
functions...

Here is my setup:

class RenderableMesh : public BasicMesh, public DynamicRenderable;

Basically, I don't want it to serialize RenderableMesh or DynamicRenderable
given a "basicMesh" pointer. The reason is because "DynamicRenderable"
derives from a class inside the "Ogre3D" engine which does a bunch of
memory management automatically. Basically, when I compile, it tells me
it's missing operator delete, because Ogre overloads operator new or
something I don't completely understand...

I'm okay with serializing the BasicMesh, and then just recreating the
RenderableMesh when it's deserialized. Which is what I'm going to have to
do anyways because I don't want to change the Ogre3D SDK header files.

It's probably super simple... If I don't implement it, it complains telling
me the derived class is not registered... Which is correct. If I try to
implement, it says operator delete is missing.

Any ideas?



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