In languages such as C#, serialising an object is reasonably trivial thanks
to reflection. This means that there are a wide selection of libraries that
deal with a variety of serialisation formats (JSON, XML, YAML etc.).
However, due to the lack of reflection, the options in C++ are somewhat limited.
Some libraries require a precompilation
step. Whilst othersrepresent the entities in an intermediate
form and provide an API such as DOM to access the properties.
Boost does actually provide a
library capable of serialising to and
from object instances, but we found the syntax a little messy and had issues with
the JSON parser not working properly (when using the stable libraries in the Ubuntu
Our library aims to provide
serialisation of objects with very little boilerplate code and uses an
intermediate tree structure to simplify the task of writing emitters and
It started life as a side project to develop an easy to use tree that could
replace an existing solution in our codebase, but we soon realised that certain
C++11 features would allow us to implement an entity mapper.