Boost logo

Boost :

Subject: Re: [boost] [async] messages threads and networks
From: Robert Ramey (ramey_at_[hidden])
Date: 2010-04-25 18:48:48


Scott Woods wrote:
> Hi Sohail,
>
>>> Also, in some cases I had goals that were simply not included in
>>> Boost implementations. Boost.Serialization does not have
>>> runtime encoding selection.
>>
>> The polymorphic archives do allow this.

> It also shows the selection of a specific archive (e.g. text);
>
> boost::archive::polymorphic_text_oarchive oa(ss);
> boost::archive::polymorphic_oarchive & oa_interface = oa;
> How does the user of the application or even the developer select a
> different
> encoding? Given the example it would take a recompilation.

nope.

string encoding;

polymorphic_oarchve * poa;
if( encoding = "Neat Bytes")
    poa = boost::archive::polymorphic_text_oarchive oa(ss);
else
   poa = boost::archive::polymorphic_binary_oarchive oa(ss);
..
    *poa << ....

> The last point is how Boost.Serialization handles UDTs/ADTs. My
> understanding
> of this area is sketchy - it appears to rely on pointers to methods
> for archiving of
> such objects.

nope - uses templates with type parameters.

> Achieving the same mobility with Boost.Serialization is at the very
> least difficult.

Well, it would require a careful study of the documentation and
understanding of how to use it.

Robert Ramey


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