From: Robert Ramey (ramey_at_[hidden])
Date: 2008-02-04 00:13:48
"JOAQUIN LOPEZ MU?Z" wrote:
> Hello Robert,
> ----- Mensaje original -----
> De: Robert Ramey <ramey_at_[hidden]>
> Fecha: Domingo, Febrero 3, 2008 8:01 pm
> Asunto: [boost] question about flyweight
> Para: boost_at_[hidden]
>> I've spent a tiny amount of time looking over the flyweight
>> documentation and some code and I have a couple minor observations
>> along with a really dumb question.
>> a) when I see boost::flyweight::flyweights it confuses me. I
>> suppose its no big deal.
> It's boost::flyweights::flyweight, actually. The reason for
> the spurious ess is explained at:
>> b) I'm curious about the serialization implementation. Why didn't
>> you choose just to serialize the factory? This seems to me the most
>> obvious implementation and I wonder why you didn't feel it was
>> a good choice.
>> In short, I don't see why a "helper" is required.
> Details aside, it all boils down to this:
> ar << f.h;
> This only works off the shelf if f.h is a pointer, which is not
> the case in general (the type of this handle is provided
> by the particular factory used, and need not be a pointer,
> for instance in set_factroy is a std::set::iterator).
> Briefly put, the serialization helper used by flyweight mimics
> for handle_type the tracking facilities Boost.Serialization
> provides natively for pointers.
The default is to track if and only if its serialized through a pointer.
If the tracking level serialization trait for flyweight<T> is set to
track_always it should work
with all objects.
I would think that you could get the effect you intend by just setting
this serialization trait.for these types.
> Joaquín M López Muñoz
> Telefónica, Investigación y Desarrollo
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk