I'm needing a fast method to read and store objects with pointers and pointers to pointers in xml files in c++ . Every object has it's own id , name , and class type.
views:
212answers:
5
+2
Q:
Fast method to read and store serialized objects with pointers and pointers to pointers in C++
+1
A:
You can't do it for pointers, you'll need to define some other method of identifying objects - like GUIDs or some other unique identifiers. In many cases you can just store the objects themselves instead of pointers.
sharptooth
2009-06-17 12:49:30
+3
A:
You should build a map of pointers to IDs as you serialise your data.
rikh
2009-06-17 12:51:59
+1
A:
Have you checked out boost::serialize?
I'm pretty sure that it automatically does one level of pointer indirection, and it is capable of writing a "form" of xml.
Richard Corden
2009-06-17 12:58:26
+1
A:
I've tried boost ,but for size of my project it's too big ( it's big , but it has high simplicity about 4-5 classes )
red777
2009-06-17 13:01:10