From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2006-02-13 11:15:14


Robert Ramey wrote:
> Reece Dunn wrote:
>> Andy Little wrote:
>
>> With this in place, transfering C++ objects across processes becomes
>> easy if you know the type of object being passed. Boost already has a
>> mechanism to
>> do this (serialization), so you could make use of the
>> Boost.Serialization library to persist the objects to a shmem memory
>> block rather than a file. Therefore, the only thing that the shmem
>> needs to provide is a serialization archive that works for its shared
>> memory resources.
>
> actually, serialization uses i/o provide by an underlying stream. So
> all one
> would need is a variation on std::strstream which uses shmem rather
> than the program memory - and you be all done!

Just use boost::iostreams::stream< boost::iostreams::array_source > using
the memory pointer and size from the shared memory as the stream used to
construct the archive.

Jeff Flinn