Skip to content
Merged
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
28 changes: 26 additions & 2 deletions tree/ntuple/inc/ROOT/RNTupleProcessor.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,30 @@ protected:
friend bool operator!=(const REntryMapping &lhs, const REntryMapping &rhs) { return !(lhs == rhs); }

public:
REntryMapping() = default;
REntryMapping(const REntryMapping &other) : REntryMapping()
{
fEntryNumber = other.fEntryNumber;
fInnerProcessorIdx = other.fInnerProcessorIdx;
fInnerMapping = other.fInnerMapping ? std::make_unique<REntryMapping>(*other.fInnerMapping) : nullptr;
fPrimaryMapping = other.fPrimaryMapping ? std::make_unique<REntryMapping>(*other.fPrimaryMapping) : nullptr;
fAuxiliaryMapping =
other.fAuxiliaryMapping ? std::make_unique<REntryMapping>(*other.fAuxiliaryMapping) : nullptr;
}
REntryMapping(REntryMapping &&other) = default;
REntryMapping &operator=(const REntryMapping &other)
{
fEntryNumber = other.fEntryNumber;
fInnerProcessorIdx = other.fInnerProcessorIdx;
fInnerMapping = other.fInnerMapping ? std::make_unique<REntryMapping>(*other.fInnerMapping) : nullptr;
fPrimaryMapping = other.fPrimaryMapping ? std::make_unique<REntryMapping>(*other.fPrimaryMapping) : nullptr;
fAuxiliaryMapping =
other.fAuxiliaryMapping ? std::make_unique<REntryMapping>(*other.fAuxiliaryMapping) : nullptr;
Comment on lines +389 to +392

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a valid implementation, but wondering if we should check for self-assignment to avoid the copy + release in that case.

return *this;
}
REntryMapping &operator=(REntryMapping &&other) = default;
~REntryMapping() = default;

ROOT::NTupleSize_t GetEntryNumber() const { return fEntryNumber; }

ROOT::NTupleSize_t operator*() const { return fEntryNumber; }
Expand Down Expand Up @@ -654,9 +678,9 @@ public:
return *this;
}

const iterator &operator++(int)
iterator operator++(int)
{
auto &obj = *this;
auto obj = *this;
++(*this);
return obj;
}
Expand Down
Loading