General
Serialization library uses RTTR information to serialize classes. Remember to register your classes in RTTR before using these serialization functionalities.
Choosing serializer
Serializer can be chosen at link time. Add one of serializers projects (SerializerJSON or SerializerXML) as referenced project. This behavior may change in future version and serializers will be rewritten to implement common interface.
Usage Examples
Serialization
BaseObject object;
bool success = serial.
Serialize(
"Serialization/GenericObject.xml",
object );
Deserialization
BaseObject object;
bool success = deserial.
Deserialize(
"Serialization/GenericObject.xml",
object );
Future plans
Serialization library is still in development process. There're many things that should be covered in future versions:
- Deserialization of polymorphic types not derived from sw::EngineObject.
- Arrays habdling:
- Serialization/deserialization of arrays nested in arrays (array ranks).
- Arrays with basic types (ints, floats and so on).
- Arrays with polymorphic types that need creation.
- Serialization/deserialization of associative containers from stl.
- Better handling of wrapped types:
- Setting objects for Properties with mixed wrapped and raw pointer types.
- Handling wrappers that don't take ownership of pointers (especially destroying these types).
- Implementing hooks for overriding serialization/deserialization for specified types.
- Make JSON and XML serializers virtual and move to sw namespace.
- Add more tests checking invalid conditions.
- Better documentation ;)
- See also
- Serialization