How to load polymorphic class without knowing its polymorphic_id?

22 views
Skip to first unread message

Romain Noël

unread,
Aug 5, 2021, 7:37:35 AM8/5/21
to cereal serialization library

Dear developers,

I would like to load an XML archive into a polymorphic pointer, therefore I followed the examples on the page https://uscilab.github.io/cereal/polymorphism.html <https://uscilab.github.io/cereal/polymorphism.html> .
But I would like to be able to load a fill without knowing the polymorphic_id value which is internal to cereal, since in my application the input XML files are filled by users not by computers.
So I could reinject the polymorphic_id information by a postprocessing of my input XML file.
This means that I need to have access to the map linking the polymorphic_id to the class names.
How can I have access to this map ? Or is it possible to load a structure into a polymorphic pointer without filling the polymorphic_id ?

Thank you by advance.

PS: these questions are strongly related to https://github.com/USCiLab/cereal/issues/709
and https://stackoverflow.com/questions/68655182/c-cereal-how-to-load-polymorphic-class-without-knowing-its-polymorphic-id

Reply all
Reply to author
Forward
0 new messages