[xsd-users] how long is a pointer still valid when working with the data object model?

Erik Sjölund erik.sjolund at gmail.com
Mon Jan 31 10:56:38 EST 2011


Ok, thanks Boris!

Does this mean that I could add an non-fundamental C++ type with

void  push_back (std::auto_ptr<X>)

multiple times but at different places? As ownership is assumed when
doing the push_back I would later have to detach in order to not cause
the object to be freed multiple times when the data object model is
freed.

The use case I have been thinking about is when you have some compute
intensive task working with a Codesynthesis XSD data object model but
you would like to print just a part of the tree to a file thousands of
time per second. You could then create an extra XML schema for that
output format. The data object model from that schema would be filled
with pointers to the compute intensive data objects (that have their
origin in another XML schema).

cheers,
Erik Sjölund



More information about the xsd-users mailing list