Boost logo

Boost :

Subject: Re: [boost] [serialization] In-memory archive?
From: Ling Li (liling_at_[hidden])
Date: 2008-10-17 12:10:13


Thanks! Using streambuffer or std::istringstream/std::ostringstream is
indeed very convenient.

Has anyone thought about introducing default values in serialization
to save the storage size (or the number of bits tranferred over
network)? I hacked NVP and make_nvp to support this as an optional
feature, and it works fine for me. If that sounds something might be
useful to others, I can paste the patch here.

On Fri, Oct 17, 2008 at 11:13 AM, Jeff Flinn
<TriumphSprint2000_at_[hidden]> wrote:
> Matthias Troyer wrote:
>>
>> On Oct 16, 2008, at 11:05 PM, Ling Li wrote:
>>
>>> Is there an easy way to serialize into a in-memory archive so that an
>>> object can be, say, transferred over a network? Of course one can use
>>> a disk file as the intermediate step but having some in-memory archive
>>> should help here.
>>
>> You can use any archive type with an in-memory streambuffer.
>> Boost.IOstreams can be used to create these streambuffers.
>
> Or just std::istringstream/std::ostringstream.
>
> Jeff


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