Note that there are some explanatory texts on larger screens.

plurals
  1. POSerializing an object with Boost for Named Pipes in c++
    text
    copied!<p>I am attempting to serialize some EEG data from a command line application using the Boost library for the serialization and sending that serialized data over a named pipe to a user interface Form built in Visual Studio C++ 2010.</p> <p>From the boost library tutorial I am able to serialize my data structure, and, <a href="http://www.boost.org/doc/libs/1_48_0/libs/serialization/doc/tutorial.html#simplecase" rel="nofollow noreferrer">http://www.boost.org/doc/libs/1_48_0/libs/serialization/doc/tutorial.html#simplecase</a></p> <p>from this tutorial on Win32 named pipes, I can construct pipes and send text between applications. <a href="http://avid-insight.co.uk/joomla/component/k2/item/589-introduction-to-win32-named-pipes-cpp?tmpl=component&amp;print=1" rel="nofollow noreferrer">http://avid-insight.co.uk/joomla/component/k2/item/589-introduction-to-win32-named-pipes-cpp?tmpl=component&amp;print=1</a></p> <p>The boost library tutorial serializes for a text file:</p> <pre><code>std::ofstream ofs("filename"); // create class instance const gps_position g(35, 59, 24.567f); // save data to archive { boost::archive::text_oarchive oa(ofs); // write class instance to archive oa &lt;&lt; g; // archive and stream closed when destructors are called } </code></pre> <p>I want to know what do I need to serialize to in order to send my data structure over a named pipe? The IOstream c++ library seems to always need a file to stream to/from?<a href="http://www.cplusplus.com/reference/iostream/" rel="nofollow noreferrer">http://www.cplusplus.com/reference/iostream/</a></p> <p>I don't want o serialize to a file and I am not sure what to serialize to? I would really appreciate it if you could tell me what I need to serialize to and it would be great if you could tell me whether another boost command will be required other than boost::archive::<strong>text_oarchive</strong> , as I have been unable to find an alternative. </p> <p>Thank you for your time! It is really appreciated!</p> <p>(This question has been asked before: <a href="https://stackoverflow.com/questions/652193/serialize-and-send-a-data-structure-using-boost">Serialize and send a data structure using Boost?</a> , but the person was told not to use boost as for his simple data structure boost would have too much overhead, so it really is still floating.)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload