[Dune] Fwd: Re: Communicating IdSet elements

Jö Fahlke jorrit at jorrit.de
Sun Jul 24 22:34:36 CEST 2011


Am Sun, 24. Jul 2011, 21:00:59 +0200 schrieb Martin Nolte:
> while we might learn from Boost how to do seriaization properly, I don't think a
> dependency on boost a good idea. Furthermore, glancing over the
> Boost::Serialization documentation, they are intended to be non-intrusive, i.e.,
> given "good" operations for conversion to and from binary, you could use boost
> on top of dune-grid. I would very much prefer such an approach over dependencies
> on boost.

Looking at it myself now.  As far as I can see, providing save/load facilities
for simple cases should be possible without actually including
Boost.Serialization.  We may need to define an empty namespace
boost::serialization somewhere to allow things like

  friend class boost::serialization::access;

But that shouldn't be a big problem.  More complicated things are derived
classes where the base classes have to be serialized as well, the
documentation says

| Do *NOT* directly call the base class serialize functions.  Doing so might
| seem to work but will bypass the code that tracks instances written to
| storage to eliminate redundancies.  It will also bypass the writing of class
| version information into the archive.  For this reason, it is advisable to
| always make member serialize functions private.  The declaration friend
| boost::serialization::access will grant to the serialization library access
| to private member variables and functions.

Worst case means we have to do #if HAVE_BOOST_SERIALIZATION.  Given there are
a lot ob things you'd want to serialize potentially, that might mean a lot of
prepreocessor-ifs.

So, I suppose providing the hooks necessary for serialization on Dune classes
would be feasible without actually requiring Boost.Serialization to be
present.  All the hooks are templates, so there isn't even an implication for
the libraries (though classes with a VMT might need a closer look here).  Only
users who actually use serialization (directly or indirectly) are required to
compile with Boost.Serialization.

I'm not really convinced that we should reimplement the actual serialization
facilities, however.  This isn't really our job and may well be more trouble
than it's worth.

Bye,
Jö.

-- 
Das Leben ist eine Krankheit, die tödlich endet.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 828 bytes
Desc: Digital signature
URL: <https://lists.dune-project.org/pipermail/dune/attachments/20110724/a859fcbe/attachment.sig>


More information about the Dune mailing list