
I'm creating a simple file that is serializing several classes to a file. The problem is the order and the number of the of the objects saved in the file, depending on the options the user selects, 1 or 3 classes can be stored, I'm confused on how to call deserializer process for this case? Maybe use the rtti type and then call the correct deserializer? For example: class baseObj { // Code // serialize code }; class optionObj : public baseObj { //Code // Serial // BOOST_SERIALIZATION_BASE_OBJECT_NVP(baseObj); // etc }; class configObj : public baseObj { //Code // Serial // BOOST_SERIALIZATION_BASE_OBJECT_NVP(baseObj); // etc }; saveData( std::string fileInfo) { // code if (userSaveConfig ) os << saveConfig; if (optionSave) os < saveOptions; } getData(std::string fileInfo) { // clueless.. 1. how to determine the order the class has been saved? }