Added serialization to C++.