C++ general question

Christian C. Berclaz ccberclaz at yahoo.com
Tue Feb 12 18:27:04 UTC 2002


I have a hierarchy of objects, which some are
plug-ins, and all are contained in a list.

They all share a virtual method to write their content
to a file as well as an equivalent read method. When
written, data are heterogeneously stored in a single
file in no particular order.

Now the question is: what is the most elegant way to
read back that file selecting the proper object
(without using a trivial switch/case as some are
unknown at compile time) and using only virtual
methods from the root object to rebuild the list in
memory.

Thanks for your help

Christian C. Berclaz




More information about the KDevelop-devel mailing list