Serialization without Boost.Serialization

前端 未结 2 1153
一生所求
一生所求 2021-01-19 01:57

I\'m trying to implement a simple serialization/deserialization method for my code to be able to pass an object over the network using MPI. In an ideal world I would have us

相关标签:
2条回答
  • 2021-01-19 02:12

    The MPI way of doing this, would be using MPI_Pack and MPI_Unpack. Of course that is C and might not be as convenient as something using C++ features. For a simple example see http://www.mcs.anl.gov/research/projects/mpi/tutorial/mpiexmpl/src/bcast/C/pack/solution.html

    0 讨论(0)
  • 2021-01-19 02:26

    Use an istrstream, which extracts from a char array. The header for this is <strstream>. And, yes, formally it's deprecated in the C++ Standard. The committee indulged in a great deal of wishful thinking in its early days. istrstream is not going to go away.

    0 讨论(0)
提交回复
热议问题