File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
SimDataFormats/GeneratorProducts/src Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -39,3 +39,19 @@ namespace hepmc_rootio {
3939 }
4040 }
4141} // namespace hepmc_rootio
42+
43+ // needed for backwards compatibility for auto_ptr<gen::PdfInfo>
44+ namespace pdfinfo_autoptr_rootio {
45+ // Following the pattern in DataFormats/TestObjects/src/classes.h
46+ template <typename T>
47+ struct deprecated_auto_ptr {
48+ // We use compat_auto_ptr only to assign the wrapped raw pointer
49+ // to a unique pointer in an I/O customization rule.
50+ // Therefore, we don't delete on destruction (because ownership
51+ // gets transferred to the unique pointer).
52+
53+ // ~deprecated_auto_ptr() { delete _M_ptr; }
54+
55+ T* _M_ptr = nullptr ;
56+ };
57+ } // namespace pdfinfo_autoptr_rootio
Original file line number Diff line number Diff line change 121121 <class name =" gen::PdfInfo" ClassVersion =" 10" >
122122 <version ClassVersion =" 10" checksum =" 876888052" />
123123 </class >
124- <class name =" std::auto_ptr< gen::PdfInfo> " />
124+ <class name =" pdfinfo_autoptr_rootio::deprecated_auto_ptr<gen::PdfInfo>" />
125+ <ioread sourceClass =" std::auto_ptr<gen::PdfInfo>" targetClass =" pdfinfo_autoptr_rootio::deprecated_auto_ptr<gen::PdfInfo>" />
125126
126127 <!-- GenRunInfoProduct -->
127128
193194 <version ClassVersion =" 11" checksum =" 4154339631" />
194195 <version ClassVersion =" 10" checksum =" 2479857328" />
195196 </class >
196- <ioread sourceClass = " GenEventInfoProduct" version =" [-11]" targetClass =" GenEventInfoProduct" source = " std::auto_ptr <gen::PdfInfo> pdf_;" target =" pdf_" >
197- <![CDATA[ pdf_.reset(onfile.pdf_.get()) ; onfile.pdf_.release() ;]]>
197+ <ioread sourceClass = " GenEventInfoProduct" version =" [-11]" targetClass =" GenEventInfoProduct" source = " pdfinfo_autoptr_rootio::deprecated_auto_ptr <gen::PdfInfo> pdf_;" target =" pdf_" >
198+ <![CDATA[ pdf_.reset(onfile.pdf_._M_ptr) ; onfile.pdf_._M_ptr = nullptr ;]]>
198199 </ioread >
199200 <ioread sourceClass = " GenEventInfoProduct" version =" [-10]" targetClass =" GenEventInfoProduct" source = " " target =" nMEPartons_" >
200201 <![CDATA[ nMEPartons_ = -1;]]>
241242 <version ClassVersion =" 14" checksum =" 905719452" />
242243 <version ClassVersion =" 15" checksum =" 898288635" />
243244 </class >
244- <ioread sourceClass = " LHEEventProduct" version =" [13]" targetClass =" LHEEventProduct" source = " std::auto_ptr <gen::PdfInfo> pdf_;" target =" pdf_" >
245- <![CDATA[ pdf_.reset(onfile.pdf_.get()) ; onfile.pdf_.release() ;]]>
245+ <ioread sourceClass = " LHEEventProduct" version =" [- 13]" targetClass =" LHEEventProduct" source = " pdfinfo_autoptr_rootio::deprecated_auto_ptr <gen::PdfInfo> pdf_;" target =" pdf_" >
246+ <![CDATA[ pdf_.reset(onfile.pdf_._M_ptr) ; onfile.pdf_._M_ptr = nullptr ;]]>
246247 </ioread >
247248 <ioread sourceClass = " LHEEventProduct" version =" [-12]" targetClass =" LHEEventProduct" source = " " target =" npLO_" >
248249 <![CDATA[ npLO_ = -99;]]>
You can’t perform that action at this time.
0 commit comments