views:

64

answers:

1

I wrote several simulation programs in C++ and want to connect their outputs/inputs with pipes (best solution would probably be to use the C++ streams).

For this I would like to serialize some objects (for example the simulations output/input are tensors and matrices). How should I handle this problem? I searched around for some time for serialization + pipes on google but was not really able to find anything about this...

Any tips on a starting point? Is it easy for example to use the boost/serialization to exchange objects with pipes? Generally I would be pleased, if serialization is text-based (to avoid rounding errors I would send hex-values rather than decimal), so I could redirect the output streams into textfiles, split them up etc... Also this way I could probably write my simulations in different programs...

Thx for all the answers!

+2  A: 

Check these libraries:

http://en.wikipedia.org/wiki/Thrift_(protocol)

http://code.google.com/apis/protocolbuffers/

Dmitry Yudakov
+1 on Google protocol buffers. This would be especially useful if you ever decided to write a simulation in Java or Python.
dave
thx.. i didn't know about these two libraries. Especially the Google Library lloks appealing to me. Thrift lacks a little bit ofdocumentation I think and also is probably somewhat of an overkill for my rather "simple" problem.I think I will first try the google library, on the other hand I just realized using some kind of validation, maybe I would be best of trying it on my own, without any serialization. I'll post here, if that makes more sense...