Reputation: 20264
I want to serialize an object in using boost in C++ then deserialize it from a C# program. So, I want to write the deserialize part by my self ( I will not deal with complex structs). Is this possible ? and where can I find the serialization protocol that Boost uses?
Upvotes: 1
Views: 55
Reputation: 392833
As the commenter said, Protocol Buffers were specified as an interoperable format by design. I would recommend using that (or one of the existing serialization libraries with similar features).
Other than that, you can look at implementing your own archive format, so you have close control of what gets serialized how.
Note that if your object graph is significantly complex, you will want to come up with some kind of Object Tracking implementation that works on both ends. This could be an area where the custom Archive implementation has no effect¹
If you are using Microsoft Visual C++ compiler (because you also use C#...) you should consider using Boost Serialization to read the C++ object graph and transforming to CLR types in a mixed-mode assembly:
¹ haven't checked.
Upvotes: 1