通过管道进行序列化
我用 C++ 编写了几个模拟程序,并希望用管道连接它们的输出/输入(最好的解决方案可能是使用 C++ 流)。
为此,我想序列化一些对象(例如模拟输出/输入是张量和矩阵)。我应该如何处理这个问题?我在谷歌上搜索了一段时间的序列化+管道,但并没有真正找到任何关于这个的东西......
关于起点有什么提示吗?例如,使用 boost/serialization 与管道交换对象是否容易?一般来说,如果序列化是基于文本的(为了避免舍入错误,我会发送十六进制值而不是十进制),我会很高兴,这样我就可以将输出流重定向到文本文件中,将它们拆分等...这样我也可以可能会在不同的程序中编写我的模拟...
感谢所有答案!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
检查这些库:
http://en.wikipedia.org/wiki/Thrift_(protocol)< /a>
http://code.google.com/apis/protocolbuffers/
Check these libraries:
http://en.wikipedia.org/wiki/Thrift_(protocol)
http://code.google.com/apis/protocolbuffers/