Boost logo

Boost Users :

From: Brian Stempel (brian65c02_at_[hidden])
Date: 2007-01-13 15:49:48


Hi,
  I am wanting to serialize some C++ data structures
into a binary stream, and I'm wanting to send that
binary stream to an embedded python interpreter, where
it can unpack the data and make use of it. So, this
doesn't seem like a typical use of the serialization
library, but I was wondering if it can still work.

My problem is that it appears (from what I can tell)
that there are various administrative bits inserted by
the serialization library into the binary stream,
meant for the "unserializer" to make use of in some
way (e.g. a header, version information, etc.) Of
course, this would mess up things for my python
reader. I'd like to, as efficiently as possible,
serialize, say, a 3d vector into a binary stream of 3
floats, and then send the raw binary data as an
argument to a python function, and have the python
function unpack this into 3 floats. This just a simple
example though, but as long as the sender (C++) and
the receiver (Python) both know the format, I could
send arbitrary information this way, as long as
there's no other bookkeeping data in the stream.

Is there any way to gain access to the raw binary
data, after I've filled things with my
binary_oarchive, so I can send it to my python
function? Or is this just not really a good use of
serialization? Thanks!


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net