Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions DataFormats/TestObjects/src/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,17 @@
// related to SchemaEvolutionTestObjects.h
#ifndef DataFormats_TestObjects_USE_OLD

// The following is from an example by Jakob Blomer from the ROOT team
// The following is from an example from ROOT team
// roottest/root/io/autoptr/TestAutoPtr_v3.hxx
namespace edmtest::compat {
template <typename T>
struct deprecated_auto_ptr {
// We use compat_auto_ptr only to assign the wrapped raw pointer
// We use deprecated_auto_ptr only to assign the wrapped raw pointer
// to a unique pointer in an I/O customization rule.
// Therefore, we don't delete on destruction (because ownership
// gets transferred to the unique pointer).
// However, since the deprecated_auto_ptr object can be reused, it is essential to always reset the
// value after using it, so we can safely delete it (it should always be nullptr)

// ~deprecated_auto_ptr() { delete _M_ptr; }
~deprecated_auto_ptr() { delete _M_ptr; }

T *_M_ptr = nullptr;
};
Expand Down
2 changes: 1 addition & 1 deletion DataFormats/TestObjects/src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ exception when running testMissingDictionaryChecking_cfg.py.
<ioread sourceClass="std::auto_ptr<edmtest::SchemaEvolutionContained>" targetClass="edmtest::compat::deprecated_auto_ptr<edmtest::SchemaEvolutionContained>"/>
<ioread sourceClass="edmtest::SchemaEvolutionAutoPtrToUniquePtr" version="[3]" targetClass="edmtest::SchemaEvolutionAutoPtrToUniquePtr" source="edmtest::compat::deprecated_auto_ptr<edmtest::SchemaEvolutionContained> contained_" target="contained_">
<![CDATA[
contained_.release(); contained_.reset(onfile.contained_._M_ptr);
contained_.reset(onfile.contained_._M_ptr); onfile.contained_._M_ptr = nullptr;
]]>
</ioread>
<class name="edmtest::SchemaEvolutionCArrayToStdArray" ClassVersion="4">
Expand Down