views:

98

answers:

2

Hi,

I am looking for recommendation for object serialization/deserialization library in c++? Which one are the most advanced and open-sourced?

Can it handle

  • Any class that users defined?
  • Object hierarchy (parent and child classes)?
  • A Tree of objects? Class A has an attribute of Class B which has an attribute of Class C?
  • STL containers? Class A has a vector of Class B?
  • A cyclic of objects? Class A has a pointer pointing to B which has a pointer to A?

I find boost serialization library. I am not sure what is its limitation from http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/tutorial.html

+1  A: 

Protocol buffers is a library developed and used by Google for object serialization that is cross language. It may be a bit different in concept from what you're describing, but it's worth taking a look at.

Eli Bendersky
+1  A: 

It really depends what you're looking for. If you're looking for super-fast speed and rapid development within a library, Boost is awesome. If you're looking for super-fast speed, a little more customizability and cross-library binary compatibility, then Qt is a great solution (not saying that Boost can't be made to do this, too). If you're looking for crazy interoperability, then look for a text-based serialization system like JSON (jsoncpp), YAML (yamlcpp) or XML (way too many), each of which have about 8 billion independent libraries.

Travis Gockel