Boost logo

Boost Users :

Subject: [Boost-users] Reducing the size of .obj file which does serialization
From: Gokulakannan Somasundaram (gokul007_at_[hidden])
Date: 2010-01-05 04:17:27


Hi,
     I have a parent class which has around 200 sub-classes. While
serializing the entire hierarchy, i have lot of base class pointers and STLs
of base class pointers. From the documentation, i found that if i have to
serialize the polymorphic pointers, then i have to do a BOOST_EXPORT of all
the relevant subclasses. But after doing that, i find my .obj file to be
around 37MB. I am using the text archive in my code. When i tried the
polymorphic_text_archive, the size only reduced by 3MB.
     Can someone help me on how i should go about reducing the .obj file
size?

Some of my questions are
a) One approach, i could think of is to create a virtual function in the
hierarchy, which just takes the Archive and does the serialization. This
would help me, because i don't need to have the BOOST_EXPORT, which
increases the size of the .obj file.
b) Why is BOOST_EXPORT required for polymorphic_text_archive? Since it
anyway uses virtual functions instead of templates, why does it need the
derived class definition.

Thanks,
Gokul.



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