Boost logo

Boost :

From: Sören Freudiger (muffmolch_at_[hidden])
Date: 2007-06-27 12:25:26

Hi @all
I have a question to

We have a lot of (derived) classes and want to register them by using
Right now we do it like this:

*** "main.cpp" ***
        #include "./../RCFExportForSerializedBasePtr.h"
        int main() { ... }

*** "RCFExportForSerializedBasePtr.h" ***
  #include <boost/serialization/export.hpp>

But what we want to have the macro BOOST_CLASS_EXPORT_GUID(...) at the end
of the header file of the derived class.
That makes a lot of things much more easy.
We tried that half a year ago and it doesn't work (we got errors, but I
cannot say which one right now).

Is this possible in gernerell? If what do I have to consider?
For this implementaton to function, the header file export.hpp has to come
after all the archive header files

Does that mean that I only have to inlcude all archive header, then
export.hpp and then the BOOST_CLASS_EXPORT_GUID can follow?

Like that:

*** inlcudeMe.h ***
#include <boost/archive/text_oarchive.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/binary_oarchive.hpp>
#include <boost/archive/binary_iarchive.hpp>

#include <boost/serialization/export.hpp>

*** GbCircle2D.h ***
#include " inlcudeMe.h"

... (declaration of GbCircle2D)

*** GbRectangle2D.h ***
#include " inlcudeMe.h"

... (declaration of GbRectangle2D)
BOOST_CLASS_EXPORT_GUID(GbRectangle2D," GbRectangle2D ")

*** main.cpp ***

        #include "./GbCircle2D.h"
        #include "./ GbRectangle2D.h"
        int main() { ... }

Best regards,

iRMB - Institute for Computational Modeling in Civil Engineering
TU Braunschweig
Pockelsstr. 3 (9th Floor)
D-38106, Braunschweig, Germany
phone +49 531/391-7595
fax   +49 531/391-7599
email freud_at_[hidden]

Boost list run by bdawes at, gregod at, cpdaniel at, john at