The world may be saved and loaded through the use of factories.
The save process is initiated with a call to World::save(). The only format that is supported right now is the one using QSettings. If World class is subclassed then the new implementation may call World::save() as part of its run.
For the components that are created using a Factory the initial creation and subsequent steps must be reproduced. As such, the factory that produced the component and the ID that was used is saved. When loading, the process is reversed by calling the Factory again. In order to be able to load their products, the factories must register themselves with the library.
At library level (AprilLibrary class) a list of callbacks that are capable of creating/retrieving factories is maintained. Each entry in this list is associated with a string. Whenever a component needs to be created following steps are taken:
AprilDream application | Documentation root |