Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-04-10 15:43:46


Preston A. Elder wrote:
> Sorry if you see this twice, but I don't think the original reply was
> sent.

> If I used this method I would end up with objects being duplicated!
>
> If I had a TEE style object and had:
> - 1 endpoint going to a local input stream
> - 1 endpoint going to disk
> - 1 endpoint going to a remote system (via. X transport method)
>
> I would end up with multiple objects because of the first endpoint!
> Every time the first endpoint saw a new object, it would allocate that
> object and deserialize it, just like the remote one would (and should)
> do. This would mean every object would be there twice!

> If, however, I could share the tracking map (eg. create a tracking
> map, then pass it to the constructor of both the input and output
> serializer, or alternatively, set it later or whatever), then this
> would not be an issue.

> The serialization library is VERY close to the functionality required
> for replication (which is more or less a specialized form of
> serialization anyway), it just has a few specific requirements that I
> don't believe would change the way serialization works or complicate
> it much more than it is now.

Perhaps you might want to experiment with this idea by fiddling
with the serialization source. Note that the "tracking map"
is part of the implementation of basic_iarchive. This is not
exposed as you would like. But there's no reason you can't
tweak the source to make it visible. Then you could implement
what it seems you want. Maybe that's a good solution for you.

Note that lots can be done by deriving from the existing archives
or make making a "Archive Adaptor" in a vein similar to
the polymorphic_iarchive.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk