|
Boost : |
Subject: [boost] [Serialization] Query
From: Alapkumar Sinha (Alapkumar.Sinha_at_[hidden])
Date: 2010-07-23 13:47:26
Hi,
I am trying to use the serialization library in the following scenario.
1. I create one instance of an object in one process
2. Serialize it either with binary/text archive
3. Then send it through unix local socket to another process where the process deserializes
Whatever examples available, it shows just archiving like below
std::ofstream ofs("filename");
// use it to build and archive
boost::archive::text_oarchive oa(ofs);
// write class instance being pointed to
// to the archive
oa << g;
/************/
But after this
1. I would like to copy the archived data to a buffer
2. Send the buffer throught a socket something like
boost::asio::write(socket, boost::asio::buffer( buffer, sizeof(buffer));
Can someone help on how I can get this done.
One more question: does the call boost::asio::write does serialization internally? If yes, still I would need how to get the buffer as mentioned in the query above a my transmission mechanism might change.
Thanks,
Alap
________________________________
This Email may contain confidential or privileged information for the intended recipient (s) If you are not the intended recipient, please do not use or disseminate the information, notify the sender and delete it from your system.
______________________________________________________________________
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk