Boost logo

Boost :

From: martin.ecker_at_[hidden]
Date: 2004-11-09 05:14:09

Peter Dimov wrote:
>> In general, I propose adding some sort of user data mechanism to
>> archives.
> What do you suggest along those lines?

We have found it necessary to associate user data with archives in
certain circumstances. In our case, I have simply added a boost::any
as member data to every archive (by introducing a base class for all
archives, since currently input and output archives do not have a
common base class).

Some classes in our system require that this boost::any contain
specific state objects that are then accessed in serialization code.
One example is the shared_ptr registry we're using, but we also have
other objects that we store as user data in archives.

For example, one part of our system uses a 3rd party library that has
its own serialization system. In order to integrate it with our system
that uses boost::serialization, we have to associate user data with a
boost::serialization archive that contains a serialization stream of
the 3rd party library. Now, if during the deserialization of our
objects we encounter a pointer to a 3rd party library object, we
trigger the 3rd party library's serialization system directly from our
serialization code.

Best Regards,

TAB Austria
Haiderstraße 40
4052 Ansfelden
Phone: +43 7229 78040-218
Fax: +43 7229 78040-209
E-mail: martin.ecker_at_[hidden]

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